tags:

views:

26

answers:

1

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.

<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.

+1  A: 

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.

A_Nablsi
How do this works it dont open a webbrowser page?
Power-Mosfet
Ok when you hit the button in your winforms application you want to open a web browser page right? so I think it won't work unless you change the POST method to GET method by providing the value in the url, let me know if this is possible.
A_Nablsi
no it doesn't work
Power-Mosfet