无法解析远程名称

时间:2021-02-24 01:57:47

i m creating mobile application for windows mobile 6.i m uploading an image on url/website. for this i m using webrequest and webresponse class.at the time of getting response i m getting this type of error-

我正在为Windows Mobile 6.i m创建移动应用程序在网址/网站上传图像。为此我使用webrequest和webresponse class.at获得响应的时间我得到这种类型的错误 -

The remote name could not be resolved.. my code is- String url = "http://weblogs.asp.net/scottgu/rss.aspx"; System.Net.WebRequest request = System.Net.WebRequest.Create(url); request.Credentials = System.Net.CredentialCache.DefaultCredentials;

无法解析远程名称..我的代码是 - String url =“http://weblogs.asp.net/scottgu/rss.aspx”; System.Net.WebRequest request = System.Net.WebRequest.Create(url); request.Credentials = System.Net.CredentialCache.DefaultCredentials;

        System.Net.WebResponse response = null;
        System.IO.Stream stream = null;
        response = request.GetResponse();
        stream = response.GetResponseStream();

any one can help me.. thx in Advance... Regards Pankaj Pareek

任何人都可以帮助我.. thx in Advance ...问候Pankaj Pareek

3 个解决方案

#1


While I don't have specific experience with Windows Mobile this error message generally indicates a failure to resolve a hostname to an IP address. This can happen for a number of reasins including:

虽然我没有Windows Mobile的特定经验,但此错误消息通常表示无法将主机名解析为IP地址。这可能发生在许多reasins包括:

  • The client can not contact the DNS server to attempt to resolve the name. This suggests a lack of network and/or internet connectivity
  • 客户端无法联系DNS服务器以尝试解析该名称。这表明缺乏网络和/或互联网连接

  • The DNS query did not yeild a result.
  • DNS查询没有结果。

Resolution Suggestions:

  1. Check that the name is correctly specified
  2. 检查名称是否正确指定

  3. Verify that there is network connectivity as this is required to communicate with the DNS server(s) used to resolve a hostname
  4. 验证是否存在网络连接,因为这需要与用于解析主机名的DNS服务器通信

  5. Check that the DNS server address is correct especially if they are configured staticlly.
  6. 检查DNS服务器地址是否正确,尤其是静态配置时。

Hope this helps

希望这可以帮助

#2


This means that while processing the URL for the web server, the underlying network connection was unable to convert the name into an IP address. The two most likely reasons this could be happening are

这意味着在处理Web服务器的URL时,底层网络连接无法将名称转换为IP地址。这可能发生的两个最可能的原因是

  1. You introduced a typo into the URL you put into the application
  2. 您在输入应用程序的URL中引入了拼写错误

  3. You are currently experiencing a DNS issue on your network
  4. 您目前在网络上遇到DNS问题

The quickest way to verify this is to try and pull up the web site in the mobile browser. If you can't pull it up it's likely a DNS issue.

验证这一点的最快方法是尝试在移动浏览器中启动网站。如果您无法提起它,则可能是DNS问题。

#3


My number one suggestion to you is to try it in the browser on the device. If it works on the browser then it should work in your code. If it doesn't then it's a setup issue on your device OR if you are connected by ActiveSync, it may be a network issue on your host machine (like a firewall).

我给你的第一个建议就是在设备上的浏览器中试一试。如果它在浏览器上工作,那么它应该在您的代码中工作。如果没有,那么这是您设备上的设置问题,或者如果您通过ActiveSync连接,则可能是主机上的网络问题(如防火墙)。

Also note that your code will NOT automatically create a cellular network connection. You are to the Connection Manager to request it before doing your web requests.

另请注意,您的代码不会自动创建蜂窝网络连接。在进行Web请求之前,您应该向Connection Manager请求它。

#1


While I don't have specific experience with Windows Mobile this error message generally indicates a failure to resolve a hostname to an IP address. This can happen for a number of reasins including:

虽然我没有Windows Mobile的特定经验,但此错误消息通常表示无法将主机名解析为IP地址。这可能发生在许多reasins包括:

  • The client can not contact the DNS server to attempt to resolve the name. This suggests a lack of network and/or internet connectivity
  • 客户端无法联系DNS服务器以尝试解析该名称。这表明缺乏网络和/或互联网连接

  • The DNS query did not yeild a result.
  • DNS查询没有结果。

Resolution Suggestions:

  1. Check that the name is correctly specified
  2. 检查名称是否正确指定

  3. Verify that there is network connectivity as this is required to communicate with the DNS server(s) used to resolve a hostname
  4. 验证是否存在网络连接,因为这需要与用于解析主机名的DNS服务器通信

  5. Check that the DNS server address is correct especially if they are configured staticlly.
  6. 检查DNS服务器地址是否正确,尤其是静态配置时。

Hope this helps

希望这可以帮助

#2


This means that while processing the URL for the web server, the underlying network connection was unable to convert the name into an IP address. The two most likely reasons this could be happening are

这意味着在处理Web服务器的URL时,底层网络连接无法将名称转换为IP地址。这可能发生的两个最可能的原因是

  1. You introduced a typo into the URL you put into the application
  2. 您在输入应用程序的URL中引入了拼写错误

  3. You are currently experiencing a DNS issue on your network
  4. 您目前在网络上遇到DNS问题

The quickest way to verify this is to try and pull up the web site in the mobile browser. If you can't pull it up it's likely a DNS issue.

验证这一点的最快方法是尝试在移动浏览器中启动网站。如果您无法提起它,则可能是DNS问题。

#3


My number one suggestion to you is to try it in the browser on the device. If it works on the browser then it should work in your code. If it doesn't then it's a setup issue on your device OR if you are connected by ActiveSync, it may be a network issue on your host machine (like a firewall).

我给你的第一个建议就是在设备上的浏览器中试一试。如果它在浏览器上工作,那么它应该在您的代码中工作。如果没有,那么这是您设备上的设置问题,或者如果您通过ActiveSync连接,则可能是主机上的网络问题(如防火墙)。

Also note that your code will NOT automatically create a cellular network connection. You are to the Connection Manager to request it before doing your web requests.

另请注意,您的代码不会自动创建蜂窝网络连接。在进行Web请求之前,您应该向Connection Manager请求它。