The following is my fragment code:
The above code works in my pc. But when I put this code to my server(Window 2000 Terminal). It doesn't work. And the error message is the following:
"The remote name could not be resolved: 'www.google.com'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote name could not be resolved: 'www.google.com'"
And I have tried surfing www.google.com in my server. It can find www.google.com. But why the above code did not work? I can't figure out how to solve it. Can anyone help me?
VB.NET:
Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
Dim myWebClient As New WebClient
myWebClient.DownloadFile(New Uri("http://www.google.com"), Request.MapPath("Files\") & "google.htm")
End Sub
The above code works in my pc. But when I put this code to my server(Window 2000 Terminal). It doesn't work. And the error message is the following:
"The remote name could not be resolved: 'www.google.com'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote name could not be resolved: 'www.google.com'"
And I have tried surfing www.google.com in my server. It can find www.google.com. But why the above code did not work? I can't figure out how to solve it. Can anyone help me?
Last edited: