Thanks and Regards,
N. Anand
//============================================
HttpWebRequest request = (HttpWebRequest
HttpWebRequest.Create(url);
request.Headers.Add("Cookie:" + "somecookie");
//============================================
HTH... Alex
--
Alex Yakhnin, eMVP
IntelliProg, Inc.
http://www.intelliprog.com
>-----Original Message-----
>I am using version 1.0 of .NET framework (because in my
2003 beta
>installation the debugger does not work properly). I have
to set a
>cookie in C# and send it to the server. The following
code throws an
>exception and fails to set the cookie properly. Could
someone tell me
>how to set the cookie from C#? The code is as follows :
>------------------------------------------------------
>urlCon = (System.Net.HttpWebRequest)
>System.Net.HttpWebRequest.Create(url);
>....
>SupportClass.URLConnectionSupport.SetRequestProperty
(urlCon, "cookie",
>sessionId); // throws an exception
>....
>System.Net.HttpWebResponse httpWebResponse =
>(System.Net.HttpWebResponse) urlCon.GetResponse();
>------------------------------------------------------
>public static void SetRequestProperty
(System.Net.HttpWebRequest
>connection, System.String key, System.String keyValue)
>{
>if (connection.HaveResponse)
> throw new System.Exception("Already connected");
>connection.Headers.Add(key, keyValue);
>}
>------------------------------------------------------
>The CookieContainer property doesn't seem to be supported
by my
>version of the compact framework.
>
>Thanks and Regards,
>N. Anand
>.
>
Thanks and Regards,
N. Anand
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
--
Robert Levy
Microsoft MVP - Mobile Devices, Smartphone
"Anand Narayana Rao" <anan...@mindtree.com> wrote in message
news:uApg11AzCHA.2684@TK2MSFTNGP11
Microsoft Development Environment 2002 version 7.0.9466
Microsoft .NET Framework 1.0 version 1.0.3705
Microsoft Smart Device Extensions for Visual Studio .NET version
7.00.2098
--
Robert Levy
Microsoft MVP - Mobile Devices, Smartphone
"Anand Narayana Rao" <anan...@mindtree.com> wrote in message
news:#Rs2EoBzCHA.2512@TK2MSFTNGP11