Hello,
irgendwie bekomme ich es nicht auf die Reihe mir die Cookies die von einem 
HttpWebRequest zurück kommen und auch mit
Headers["Set-Cookie"] überprüft im HttpWebResponse mitgeliefert werden in die 
eigentliche Ausgabeseite bzw in den Header des
eigentlicehn Response zu schreiben...
Was mach ich da falsch...?

Folgend hab ich mal meinen Code geposted:

------------
CookieContainer cookies = new CookieContainer(); 

// Aktuelle Seite auslesen
string path = Request.ServerVariables["PATH_INFO"].ToString();
path = "http://localhost/"; + path.Substring(0,path.Length-1)+ 
"?"+Request.QueryString + Request.Form;



//CREATE A REQUEST TO THE ASP PAGE
HttpWebRequest myRequest = (HttpWebRequest) WebRequest.Create(path);
myRequest.CookieContainer = cookies;


// GET THE RESPONSE
HttpWebResponse myResponse = (HttpWebResponse) myRequest.GetResponse();
myResponse.Cookies = myRequest.CookieContainer.GetCookies(myRequest.RequestUri);


//** Debug                      
Response.Write(myResponse.Headers["Set-Cookie"]);
Response.Write(myResponse.Cookies.Count);
//**

string myName;
string myValue;

foreach (Cookie oRespCookie in myResponse.Cookies) {
        myName  = oRespCookie.Name;
        myValue = oRespCookie.Value;
        HttpCookie myHttpCookie = new HttpCookie(myName,myValue);
        Response.Cookies.Add(myHttpCookie);
}

StreamReader SR = new 
StreamReader(myResponse.GetResponseStream(),Encoding.GetEncoding(1252));
HttpContext.Current.Response.Write(SR.ReadToEnd());
-------------

Wäre für jede Hilfe dankbar.

Gruß, Hans

_______________________________________
take11 IT Development - Hans Pickelmann                        
                                                       
Platenstrasse 64     Fon:       +49 (0)911 / 938 907 6
90441 Nürnberg       Fax:       +49 (0)911 / 285 395 1
Germany              Mobil:     +49 (0)170 / 903 424 3
                     E-Mail:    mailto:[EMAIL PROTECTED]
                     Internet:  http://www.take11.de
                     Blog:      http://jack-geronimo.de

_______________________________________________
Asp.net Mailingliste, Postings senden an:
Asp.net@glengamoi.com
An-/Abmeldung und Suchfunktion unter:
http://www.glengamoi.com/mailman/listinfo/asp.net

Reply via email to