microsoft.net framework / classes  | |
May 1st, 2005, 02:17 AM
|
#1 (permalink)
| | Member
Join Date: Oct 2003
Posts: 263
| microsoft.net framework / classes
Hi guys,
I am a network eng. and not to much of a programmer but I can code little things. I have a question with the .net framework. I know with C# and VB.net you can see the classes like for instance the websession or registry changes. I am not sure how to call the classes though. A method or constructor is a little past my knowledge. If someone could explain how would I call a class in the .net framework it would really help me out. For instance if i wanted to call system.web.sessionstate to create a web session, how would i do that? I see under Methods there is an add....
In my code if I just type system.web.sessionstate.add ("test","true") it will give me an compiling error.
Any help to get me started would be great.
Thank you |
| |
May 1st, 2005, 02:40 AM
|
#2 (permalink)
| | Perfetc Member
Join Date: Jan 2003 Location: Maryland Suburbia
Posts: 4,334
|
Well... im not sure on .net specfically, but generally you create an object which is an instance of a class.... and when you create that object depending on your parameters it calls are certain constructor (just a special method inside the class, generally designated by the absense of a return type and the same name as the class). |
| |
May 5th, 2005, 10:01 PM
|
#3 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,552
|
First off SessionState is a namespace, not a class. You can't make a "SessionState" variable. That being said sessionState includes an HttpSessionState class which I am guessing is what you want to use.
In C# call the constructor as such:
HttpSessionState mySession = new HttpSessionState();
If you don't understand classes/constructors you are going to have trouble using them. Simple as that man. |
| |
May 7th, 2005, 11:10 PM
|
#4 (permalink)
| | Unregistered
Join Date: Apr 2003
Posts: 423
| |
| |
May 10th, 2005, 11:49 PM
|
#5 (permalink)
| | Member
Join Date: Feb 2004
Posts: 59
| Quote: |
Originally Posted by jkrohn First off SessionState is a namespace, not a class. You can't make a "SessionState" variable. That being said sessionState includes an HttpSessionState class which I am guessing is what you want to use.
In C# call the constructor as such:
HttpSessionState mySession = new HttpSessionState();
If you don't understand classes/constructors you are going to have trouble using them. Simple as that man. | Just to add to it, anytime you want to use it afterwards, you'd refer to it as mySession.web.sessionstate.add ("test","true") |
| |
May 14th, 2005, 02:51 AM
|
#6 (permalink)
| | Member
Join Date: Oct 2003
Posts: 263
|
I know I am not a programmer so I am still learning about classes. If you can, could you show me an example of lets say writing a registry node using the Microsoft.Win32.RegistryKey in .NET. If you could please show me everythign I would have to do in order to create the registry key. I think once I can see all the code and steps it should make more sense. I appreciate any help. |
| |
May 17th, 2005, 01:30 AM
|
#7 (permalink)
| | Member
Join Date: Feb 2004
Posts: 59
|
I'm sorry, but I don't know much about system programming. I'm more application development, and I don't know that much about C# or VB. |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |