473,499 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datatypes: HTTPCookie and Strings

Does anyone know if it is possible to change the datatype of a string into an
HTTPCookie?

I tried CType and it would not let me do it.
Nov 7 '07 #1
3 1170
Paul wrote:
Does anyone know if it is possible to change the datatype of a string into an
HTTPCookie?

I tried CType and it would not let me do it.
No, you can't do that. You have to create a new HttpCookie object and
put the string into it. A cookie needs two string values, a name and a
value, so unless you want to use your string both as name and value
(which is rather pointless), you need another string to create the
cookie object.

--
Göran Andersson
_____
http://www.guffa.com
Nov 8 '07 #2
Would it be possible to put the string directly into a CookieContainer?

"Göran Andersson" wrote:
Paul wrote:
Does anyone know if it is possible to change the datatype of a string into an
HTTPCookie?

I tried CType and it would not let me do it.

No, you can't do that. You have to create a new HttpCookie object and
put the string into it. A cookie needs two string values, a name and a
value, so unless you want to use your string both as name and value
(which is rather pointless), you need another string to create the
cookie object.

--
Göran Andersson
_____
http://www.guffa.com
Nov 8 '07 #3
LVP
CookieContainer Contains Cookies
Create a Cookie then Hydrate it with name value pair(s) then place that
newly created cookie in the CookieContainer.

Are you talking about serialized cookie as a string?

"Paul" <Pa**@discussions.microsoft.comwrote in message
news:C6**********************************@microsof t.com...
Would it be possible to put the string directly into a CookieContainer?

"Göran Andersson" wrote:
>Paul wrote:
Does anyone know if it is possible to change the datatype of a string
into an
HTTPCookie?

I tried CType and it would not let me do it.

No, you can't do that. You have to create a new HttpCookie object and
put the string into it. A cookie needs two string values, a name and a
value, so unless you want to use your string both as name and value
(which is rather pointless), you need another string to create the
cookie object.

--
Göran Andersson
_____
http://www.guffa.com

Nov 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10606
by: Jan Agermose | last post by:
Im writing information into an existing excel document using a connection string like: strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Filename + ";Extended Properties=\"Excel...
1
1591
by: chris | last post by:
I'm struggling with using the HttpCookie object on a code behind. Used in the page works great I'm getting a: Type 'HttpCookie' is not define I've tried adding the namespace to the vb form but no...
0
1531
by: Chris | last post by:
Just a curiosity: Is it standard practice to UrlEncode and UrlDecode cookie values? I wouldn't have even stumbled across this except I noticed that when I retrieve a cookie that was set with...
1
328
by: Jan Agermose | last post by:
Im writing information into an existing excel document using a connection string like: strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Filename + ";Extended Properties=\"Excel...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.