try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://www.site.ru/group/" + gr);
request.AllowAutoRedirect = false;
request.Method = "GET";
request.CookieContainer = cookies;
request.UserAgent = "Opera/9.80 (Windows 7; U; en) Presto/2.9.168 Version/11.50";
request.ContentType = "application/x-www-form-urlencoded";
HttpWebResponse response_headers = (HttpWebResponse)request.GetResponse();
System.IO.Stream stream = response_headers.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(stream);
string response = sr.ReadToEnd();
sr.Close();
/*if (response_headers.Headers["Location"].Contains("alted"))
{
log("[-] GROUP is " + gr + " closed\r\n");
return -2;
}*/
string gash = Regex.Match(response, @"gwtHash:""(?<id>[^""]+)""").Groups["id"].Value;
string grpId = Regex.Match(response, @"state:""st.cmd=altGroupMain&st.groupId=(?<id>[^""]+)""").Groups["id"].Value;
}
catch { log("[?] Can't parse ash and grpId\r\n"); return -1; }
如果 {} 被注释,则此代码在构造时成功运行。但是当我删除评论并运行它时,我收到[?] Can't parse ash and grpId
Why?=\