How to read javascript file using HttpWebRequest in c# -


I have a javascript file in the remote server, and when I use httpwebrequest it gives some strange letters.

thr url

Is this kind of compressed material?

  Static String GetScriptSource (string _url) {string _retValue = string.Empty; HttpWebRequest hwr = (HttpWebRequest) WebRequest.Create (_url); Hwr.method = "GET"; HttpWebResponse Res = (HttpWebResponse) hwr.GetResponse (); Streamer sr = new streamrider (res.GetResponsestream ()); Return sr.ReadToEnd (); }   

My code is very simple to read the contents of that script file.

This can be done by looking at the JS source you have linked to, Try saving as you try and use 7zip or something to see if you can open it. There is a GGIP Library in C #, if it has been gipped, you should be able to open it easily.

Although it is a Korean web site, so maybe encoding is not correct.

Either way it's not a problem with the code you posted.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -