javascript - How to send to a web-server request for performing js-function under c#? -


First of all, English is my foreign language under C # I receive an audio file (stream) with the accent of some words. Trying to send a post http request to forvo.com (bank with the pronunciation of words) For example, I want to click on button 1 and want to hear the word "stack" From the .com site. I have a code for this:

 use  (var wb = new webclient ()) {var data = new nameValueCollection (); Data ["LANGUAGE_ID"] = "3 9"; Data ["WORD"] = "Monday"; // This tag is not effective for requesting // var response = wb.UploadValues ​​("http://www.forvo.com/search/", "POST", data); Byte [] response = wb.UploadValues ​​("http://www.forvo.com/search/data", "POST", data); File. WritAllBytes (Path.GetDirectoryName (application.ExecutablePath) + "\\ fi2le.html", feedback); }  

With that action, I am trying to get the link for an audio file. After viewing a file.html I see these strings

   & Lt; / A & gt; & Lt; A href = "/ word / data / # n" title = "data pronunciation" & gt; Data & lt; / A & gt; And others are looking similar  

What can I do with these JS-Functions or what is it?

I'm a newbie in web programming, and I do not know anything about JS. And I know that forvo.com has its own API for things like me, but I'm trying to make it without the API.

What's going on here, by clicking on the icon javascript play () function is turned

this function does have the basic 64-encoded values, and uses them to find the relevant file to play, and you have a audio < / Code> are using the browser able to understand the element (html5) in which to play it, or, if not, it is a flash Leyr makes which to run it.

Play () a second and said third logic function as the Base64 encoded URI files to play them quite simply as follows ( for example, a console application) can be decoded:

  static void main () {string base64a = "ODk3NTU5NS8zOS84OTc1NTk1XzM5XzE3MjNfMjI4MjAubXAz"; String base 64 b = "ODk3NTU5NS8zOS84OTc1NTk1XzM5XzE3MjNfMjI4MjAub2dn"; Console.WriteLine (Encoding.Default.GetString (Convert.FromBase64String (base64a))); Console.WriteLine (Encoding.Default.GetString (Convert.FromBase64String (base64b)); Console.ReadKey (); }  

If you run this, you will find that they convert to:

  8975595/39 / 8975595_39_1723_22820.mp3 8975595/39 / 8975595_39_1723_22820.ogg The  

run function contains some arguments for which to use, but in the end, I'm finally playing the following file:

  http://audio.forvo.com/mp3/8975595/39/8975595_39_1723_22820.mp3  

this work should be done in JavaScript as much Depend on browser or device that is requesting, as Highlighted above (HTML5 capability for example)

add me, though, what is happening is that it is expected that when expected, if as I suspect that this solution Will be of any use; As a paywall exists on 500 requests, I would have thought that they will be in the period of time looking for multiple requests from the same IP address, and will prevent any such address from avoiding the payment.


Comments