0
完整的例外是這樣的:System.Net.WebException」發生在System.dll中
An exception of type 'System.Net.WebException' occurred in System.dll but was not handled in user code
Additional information: The remote server returned an error: (404) Not Found.
我的代碼如下所示:
Public Function GetHash(password As String) As String Implements IHashManager.GetHash
Dim uRL As String = HttpContext.Current.Request.Url.Scheme & "://" & HttpContext.Current.Request.Url.Host & ":" & HttpContext.Current.Request.Url.Port & "/md5_hash.asp?val=" & password
' Dim myWebClient As New Net.WebClient
Using myWebClient As New Net.WebClient
Return myWebClient.DownloadString(uRL)
End Using
End Function
它輕視回線除外。
該代碼的目的是使用當前URL返回密碼的哈希值。我沒有寫這個代碼,我不確定它爲什麼會出錯。有誰知道爲什麼?
你也不應該使用你不明白的代碼。 –
感謝您的回覆,此問題的目的是爲了更好地理解代碼並解決問題。我儘量不使用我不明白的代碼 – Andrew