无法解析远程名称 [英] The remote name could not be resolved

查看:107
本文介绍了无法解析远程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试将.aspx页面转换为html以作为电子邮件正文发送。



我正在使用的代码是



Hi,

I am trying to convert .aspx page to html to send as body of an email.

The code I am using is

private string HttpContent()
    {
        try
        {

            WebRequest objRequest = System.Net.HttpWebRequest.Create(@"http://xxxxx.com/");
            System.IO.StreamReader sr = new System.IO.StreamReader(objRequest.GetResponse().GetResponseStream());
            string result = sr.ReadToEnd();
            sr.Close();
            return result;
        }
        catch (Exception ex)
        {
            // Error occured grabbing data, return empty string.
            return ex.Message;
        }
    }





结果是



The result is

The remote name could not be resolved: 'xxxxx.com'







info:


这里以
http://xxxxx.com为例。



任何帮助都会感激不尽。



我尝试了什么:



我尝试了上面提到的代码。




info:

http://xxxxx.com is used here as an example.

any help will be thankful.

What I have tried:

I tried the above mentioned code.

推荐答案

例如,参见: c# - System.Net.WebException:无法解析远程名称: - Stack Overflow [ ^ ]。


这篇关于无法解析远程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆