执行URL获取页面内容
2015-12-19 20:56:32 访问(2006) 赞(0) 踩(0)
/// <summary>
/// 执行URL获取页面内容
/// </summary>
public static string UrlExecute(string urlPath)
{
if (string.IsNullOrEmpty(urlPath))
{
return "error";
}
StringWriter sw = new StringWriter();
try
{
HttpContext.Current.Server.Execute(urlPath, sw);
return sw.ToString();
}
catch (Exception)
{
return "error";
}
finally
{
sw.Close();
sw.Dispose();
}
}
标签:
执行URL获取页面内容 


上一条:
下一条:
相关评论
发表评论