[英]Can't get response from HTTP Post method in C#
目标链接是http://www.fyneworks.com/encryption/rc4-encryption/index.asp
使用LiveHttpHeaders
,我找到了参数
auth=gfmpgjixhpFhGnKFrHUmn2eHmHhigxkr&decrypt=8a+2d+2f+36
&key=102&decrypted=Paste+your+data+here
但我无法从中得到回应。
我使用下面的C#
代码。
txtboxText.Text = txtboxText.Text.Replace(" ", "+");
WebClient client = new WebClient();
string auth = client.DownloadString("http://www.fyneworks.com/encryption/rc4-encryption/index.asp");
string Search4This1="<input name=\"auth\" type=\"hidden\" value=\"";
string Search4This2="\"";
int start = auth.IndexOf(Search4This1) + Search4This1.Length;
int end = auth.IndexOf(Search4This2, start);
auth = auth.Substring(start, end - start);
MessageBox.Show(auth);
string downloadstring = client.DownloadString("http://www.fyneworks.com/encryption/rc4-encryption/index.asp?auth="+auth+"decrypted="+txtboxKey.Text.ToString()+"&key="+txtboxKey.Text.ToString());
System.IO.File.WriteAllText(@"C:\htmlcode.txt", downloadstring);
结果:
<h2>RC4 Decryption Tool</h2>
<form class="tool" action="/encryption/rc4-encryption/index.asp" method="post">
<input name="auth" type="hidden" value="cmkGdih1ht0dGHmkIGzmlDilJJDMmTho"/>
<table width="100%" cellspacing="0">
<tr>
<td valign="middle" align="center" width="50%">
<h3>Encrypted data</h3>
<textarea name="decrypt">CC 0F 1F 0B 6A 00 5A A7 97 14 9C D7 00 76 84 27 C4 0C 73 68</textarea>
<span class="B Warning">Encoded into a <u>hexadicimal string</u></span>
</td>
<td valign="middle" align="center" width="100">
<u>Key</u>:<br/>
<input name="key" type="text" value='102' style="width:90px;"/><br/>
<input type="image" src="http://www.fyneworks.com/encryption/inc/decrypt.png" alt="ENCRYPT »"/>
</td>
<td valign="middle" align="center" width="50%">
<h3>Original data</h3>
<textarea class="result" name="decrypted"></textarea>
您传递参数的方式是错误的。 看一下这个问题和答案 ,看看如何正确地做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.