此代码是否会发出http请求,或者只是伪造它?
var writer = TextWriter.Null;
var response = new HttpResponse(writer);
var request = new HttpRequest("DummyFile.aspx", HttpContext.Current.Request.Url.ToString(),
"__EVENTTARGET=true&__VIEWSTATEENCRYPTED=true");
var context = new HttpContext(request, response);
var page = new Page
{
EnableViewStateMac = true,
ViewStateEncryptionMode = ViewStateEncryptionMode.Always
};
page.ProcessRequest(context);
答案 0 :(得分:1)
假装存在HttpRequest。执行此代码时,没有任何内容可以通过网络。