Open Url sending POST
I have the this function which it has been written in html. you put a md5 value in the textbox and hit the button to start searching.
开发者_JAVA百科<form action="http://www.virustotal.com/vt/en/consultamd5" method="post">
<input name="hash" >
<input type="submit" value="get MD5">
My question is how do I do the something like the html function I have mentioned above, open an url, post something and see the results in the opened page?
For example in winforms put an md5 value in an textbox hit the button to start searching.
Use the HttpWebRequest as the following,
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://www.virustotal.com/vt/en/consultamd5");
req.Method = "POST";
Stream s = req.GetRequestStream();
StreamWriter sw = new StreamWriter(s);
sw.Write("hash=yourtexthere");
sw.Flush();
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
Or you can use MD5 in .net which is located in System.Cryptography.MD5 instead.
精彩评论