string IP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(IP)) { //沒有代理IP則直接取客戶端IP IP = Request.ServerVariables["REMOTE_ADDR"]; } Response.Write(IP); Response.End(); 這樣.當(dāng)測(cè)試代碼中去訪問ip.aspx文件時(shí)."string IP = stream.ReadToEnd();"這段代碼...