cs端调用Ajax

 private static string Descoder()

        {

           //ajax地址

            string MealFilePath = "http://***/user/SetWebsite.aspx";



            WebResponse result = null;

            WebRequest req = WebRequest.Create(MealFilePath);

            result = req.GetResponse();

            Stream sr = result.GetResponseStream();

            Encoding encode = System.Text.Encoding.GetEncoding("GB2312");

            StreamReader strAddress = new StreamReader(sr, encode);

            return strAddress.ReadToEnd();

        }
View Code

你可能感兴趣的:(Ajax)