jt
2021-06-10 5d0d028456874576560552f5a5c4e8b801786f11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Web;
using System.Text.RegularExpressions;
using System.Web.UI.HtmlControls;
using System.IO;
using System.IO.Compression;
using System.Web.UI.WebControls;
using System.Text;
using System.Collections.Generic;
 
namespace HH.WMS.Utils
{
    /// <summary>
    /// WEB请求上下文信息工具类
    /// </summary>
    public partial class ZHttp
    {
        #region 获取当前站点的Application实例
        /// <summary>
        /// 获取当前站点的Application实例
        /// </summary>
        public static System.Web.HttpApplicationState Application
        {
            get
            {
                return HttpContext.Current.Application;
            }
        }
        #endregion
 
        #region 取得页面返回的信息
        public static string Get_url_data(string url)
        {
            url = RootFullPath + url.Trim('/');
            string Url_Data = "";
            try
            {
                System.Net.WebRequest Request = System.Net.WebRequest.Create(url);
                System.Net.WebResponse Response = Request.GetResponse();
                System.IO.Stream resStream = Response.GetResponseStream();
                System.IO.StreamReader sr = new System.IO.StreamReader(resStream, System.Text.Encoding.Default);
                Url_Data = sr.ReadToEnd();
                resStream.Close();
                sr.Close();
            }
            catch { }
            return Url_Data.Trim();
        }
        #endregion
    }
}