一般处理程序获得一个链接返回的值:
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string openid = context .Request ["openid"].ToString(); string num = GetFunction("http://wap.quantumfilm.com.cn/2016/Selec_Openid.aspx?Openid=" + openid); context.Response.Write(num); } //get public static string GetFunction(string url) { string serviceAddress = url; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress); request.Method = "GET"; request.ContentType = "text/html;charset=UTF-8"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream myResponseStream = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.UTF8); string retString = myStreamReader.ReadToEnd(); myStreamReader.Close(); myResponseStream.Close(); return retString; }