0
這是現在我的代碼:我不能發佈數據發送到另一臺服務器
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>";
https://juzcode.com/post.php似乎不可連接 - 我的瀏覽器在長時間等待後很高興地超時。 – 2011-05-17 23:28:34
@Will A出於某種原因,我的Firefox也這麼做。但它在Chrome上正常工作。我不知道爲什麼,看到我編輯的問題 – Pacerier 2011-05-18 05:38:23