您好,我正在尝试编译自己制作的程序,但遇到了一个我不知道如何解决的错误。我已经尝试了所有我能想到的解决方案,并想看看是否有人可以帮助我修复它 这是发生错误的代码。
string text4 = string.Format("X-XSRF-TOKEN={0}&X-XSRF-URI=%2Flogin%2FdoLauncherLogin&fromForm=yes&authType=&linkExtAuth=&epic_username={1}&password={2}&rememberMe=YES", attributeValue, arg, arg2);
httpRequest.Cookies = httpResponse.Cookies;
xNet.HttpResponse httpResponse2 = httpRequest.Post("", text4, "application/x-www-form-urlencoded; charset=UTF-8");
if (httpResponse2.StatusCode == 200)
{
ref int ptr = ref this.int_0;
this.int_0 = ptr + 1;
ptr = ref this.int_2;
this.int_2 = ptr + 1;
backgroundWorker.ReportProgress(0, text);
if (this.bool_0)
{
this.queue_1.Enqueue(text2);
}
}
答案 0 :(得分:0)
使用枚举HttpStatusCode
:
if (httpResponse2.StatusCode == HttpStatusCode.OK)
答案 1 :(得分:0)
您应该使用相应的 Enum 值
if (httpResponse2.StatusCode == HttpStatusCode.OK)
答案 2 :(得分:0)
我相信您需要使用HttpStatusCode
枚举,而不仅仅是状态码作为整数。所以
httpResponse2.StatusCode == 200
应该成为
httpResponse2.StatusCode == HttpStatusCode.OK
。