【发布时间】:2011-05-17 23:24:39
【问题描述】:
这是我现在的代码:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
System.Net.ServicePointManager.Expect100Continue = False
Dim client = New System.Net.WebClient()
Dim postdata = New System.Collections.Specialized.NameValueCollection
postdata.Add("username", "qweqwe")
postdata.Add("password", "asdasd")
Dim bytes = client.UploadValues("https://juzcode.com/post.php", postdata) ' exception here
Response.Write(Encoding.ASCII.GetString(bytes))
End Sub
但是我收到异常“无法连接到远程服务器”。我做错了吗?
顺便说一句,这是http://juzcode.com/post.php的代码:
<?php if($_POST["username"]==="qweqwe" && $_POST["password"]==="asdasd")echo "<b>success</b>";else echo "<i>failed</i>";
【问题讨论】:
-
juzcode.com/post.php 似乎无法连接 - 我的浏览器在漫长的等待后愉快地超时了。
-
@Will A 出于某种原因,我的 Firefox 也这样做了。但它在 Chrome 上运行良好。我不知道为什么,请参阅我编辑的问题
标签: asp.net vb.net web-services