WebClient GET请求似乎在C#中不执行任何操作

时间:2020-09-14 01:05:24

标签: c# php visual-studio http

我创建了一个简单的PHP脚本,该脚本向文本文件添加了行。 当我在浏览器中键入url时,它会很好地添加到文本文件中。 但是,在C#中执行似乎简单的操作似乎无效。当我在Windows窗体应用程序中运行此代码时,没有任何内容添加到文本文件中

WebClient webClient = new WebClient();
webClient.QueryString.Add("name", "one");
webClient.QueryString.Add("status", "off");
string result = webClient.DownloadString("http://example.com/submit.php?");

我也尝试过这样做:

webClient.DownloadString("http://example.com/submit.php?name=one&status=off");

我浏览了无数帖子,并尝试了httpgetrequest。似乎什么也没添加一行文本。

这是我的输出控制台:

'CSHARP.exe' (CLR v4.0.30319: CSHARP.exe): Loaded 

'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("1aced16c4a6991033825473de09075a3");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://example.com/submit.php?name=one&status=off&i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>
'CSHARP.exe' (CLR v4.0.30319: CSHARP.exe): Loaded 'D:\Drive\WORK\CSHARP\CSHARP\bin\Debug\Newtonsoft.Json.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

0 个答案:

没有答案