使用带有登录页面的HttpWebRequest发送数据

Raw*_*hi 6 c# authentication post httpwebrequest

我正在尝试使用HttpWebRequest类为此页面发送数据:

www.stage1.darotools.com/Quran.v1.admin/_FormsWizard/CreateForm.asp
Run Code Online (Sandbox Code Playgroud)

但是我遇到了登录验证的问题.继承我的代码:

    System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
    string postData = "ctlMessageID=" + 348;
    postData += ("&ctlUserID=" + 7);
    postData += ("&ctlTitle=" + 7);
    postData += ("&ctlEmail=" + "rrawhi@gmail.com");
    postData += ("&ctlIsSystem=" + 0);
    postData += ("&ctlFormBody=");
    postData += ("&ctlEnableCaptcha=");
    postData += ("&ctlEmailAttachedFiles=");
    postData += ("&ctlMailingList=");
    postData += ("&ctlCommentaryTitle=" + 1);
    postData += ("&ctlIsActive=" + 2);
    postData += ("&ctlCommentaryPersonID=" + 6);
    postData += ("&ctlOrderKey=");
    postData += ("&Commentary_TextControl_html=" + "aaaaaaaaaaaa");
    postData += ("&controlValue4=" + 666666);
    postData += ("&ctlLanguageID=" + 1);
    postData += ("&ctlAya=" + 349);
    postData += ("&PathInfo=" + "dbsFramed, dbsFramed");
    postData += ("&Caller=" + "rawhi");
    byte[] data = encoding.GetBytes(postData);

    // Prepare web request...
    HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://stage1.darotools.com/Quran.v1.admin/_FormsWizard/CreateForm.asp");
    myRequest.Method = "POST";
    myRequest.ContentType = "application/x-www-form-urlencoded";
    myRequest.ContentLength = data.Length;
    Stream newStream = myRequest.GetRequestStream();
    // Send the data.
    newStream.Write(data, 0, data.Length);
    newStream.Close();
Run Code Online (Sandbox Code Playgroud)

这是登录页面:

www.stage1.darotools.com/Quran.v1.admin/Login.asp
Run Code Online (Sandbox Code Playgroud)

提前致谢.