First of all, it looks like you are not actually sending the request. To send a POST request to the server, you need to request a response:
HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse(); string responseContent = null; using (StreamReader reader = new StreamReader(response.GetResponseStream())) {
Also, it looks like the page you're submitting is looking for an established and terminated session. First try sending your credentials to the login page (http://stage1.darotools.com/Quran.v1.admin/Login.asp). Install HttpWebRequest.CookieContainer in a new instance of CookieContainer (). Then make another message on the CreateForm.asp page, but be sure to set the new CookieContainer instance for the new HttpWebRequest.CookieContainer object that you used when you made the POST on the login page. Then the cookies received from the login page will be sent to the CreateForm.asp page and the session will be “supported” from the server’s point of view. For example:
CookieContainer m_cookies = new CookieContainer(); HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://stage1.darotools.com/Quran.v1.admin/Login.asp"); ... HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse(); HttpWebRequest formRequest = (HttpWebRequest)WebRequest.Create("http://stage1.darotools.com/Quran.v1.admin/_FormsWizard/CreateForm.asp"); formRequest.CookieContainer = myRequest.CookieContainer; using (StreamReader reader = new StreamReader(response.GetResponseStream())) {
Brady
source share