3 Vista questions
-
Hi, I have 3 quick Vista questions. The first question, is how can I tell if my program is running on Vista? (I've run accross the OperatingSystem class and the Environment.OSVersion value in my googling, but I can't find out if this class should be used for Vista, or what values I'd need to look for.) My second question, is how do I get to the users applications folders? (I know that they're all in the C:\Users\ folder, but I don't know how to get to a specific users folder.) My last question is to do with Services in Vista. I need to start a service from my program if it hasn't already been started. However when trying to start it (using the myservice.Start() function) I get a InvalidOperationException. I've been told that this is a security issue with the program, however running the program as administrator doesn't help. Anyone have any clue as to how to get around this problem? Thanks in advance, Munty
-
Hi, I have 3 quick Vista questions. The first question, is how can I tell if my program is running on Vista? (I've run accross the OperatingSystem class and the Environment.OSVersion value in my googling, but I can't find out if this class should be used for Vista, or what values I'd need to look for.) My second question, is how do I get to the users applications folders? (I know that they're all in the C:\Users\ folder, but I don't know how to get to a specific users folder.) My last question is to do with Services in Vista. I need to start a service from my program if it hasn't already been started. However when trying to start it (using the myservice.Start() function) I get a InvalidOperationException. I've been told that this is a security issue with the program, however running the program as administrator doesn't help. Anyone have any clue as to how to get around this problem? Thanks in advance, Munty
-
Hi, I have 3 quick Vista questions. The first question, is how can I tell if my program is running on Vista? (I've run accross the OperatingSystem class and the Environment.OSVersion value in my googling, but I can't find out if this class should be used for Vista, or what values I'd need to look for.) My second question, is how do I get to the users applications folders? (I know that they're all in the C:\Users\ folder, but I don't know how to get to a specific users folder.) My last question is to do with Services in Vista. I need to start a service from my program if it hasn't already been started. However when trying to start it (using the myservice.Start() function) I get a InvalidOperationException. I've been told that this is a security issue with the program, however running the program as administrator doesn't help. Anyone have any clue as to how to get around this problem? Thanks in advance, Munty
1.
System.Environment.OSVersion.Version.Major > 5
2.Application.LocalUserAppDataPath
3. UseNet start
.Deja View - the feeling that you've seen this post before.
-
We have a Vista board for your questions.
_____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!
Did you read his questions or just fire off the subject? They're all "how do I make my C# program do Foo", not "where in the vista control panel is foo hiding" questions.
-- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
-
Hi, I have 3 quick Vista questions. The first question, is how can I tell if my program is running on Vista? (I've run accross the OperatingSystem class and the Environment.OSVersion value in my googling, but I can't find out if this class should be used for Vista, or what values I'd need to look for.) My second question, is how do I get to the users applications folders? (I know that they're all in the C:\Users\ folder, but I don't know how to get to a specific users folder.) My last question is to do with Services in Vista. I need to start a service from my program if it hasn't already been started. However when trying to start it (using the myservice.Start() function) I get a InvalidOperationException. I've been told that this is a security issue with the program, however running the program as administrator doesn't help. Anyone have any clue as to how to get around this problem? Thanks in advance, Munty
Adding to what Pete said, NT is known as 5.0, XP is 5.1 and Vista is 6.0 (the next big client OS will be 7.0) :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Hi, I have 3 quick Vista questions. The first question, is how can I tell if my program is running on Vista? (I've run accross the OperatingSystem class and the Environment.OSVersion value in my googling, but I can't find out if this class should be used for Vista, or what values I'd need to look for.) My second question, is how do I get to the users applications folders? (I know that they're all in the C:\Users\ folder, but I don't know how to get to a specific users folder.) My last question is to do with Services in Vista. I need to start a service from my program if it hasn't already been started. However when trying to start it (using the myservice.Start() function) I get a InvalidOperationException. I've been told that this is a security issue with the program, however running the program as administrator doesn't help. Anyone have any clue as to how to get around this problem? Thanks in advance, Munty
-
1.
System.Environment.OSVersion.Version.Major > 5
2.Application.LocalUserAppDataPath
3. UseNet start
.Deja View - the feeling that you've seen this post before.
Hi Pete, Thanks for the other 2 answers. They're doing what I want them to. :) Net Start doesn't work on the Vista machine I have. It gives me an "System Error 5" message. Just to note, but the "myservice.Start()" and "Net Start "myservice"" works on my XP machine. Some further information about the service. As long as I start the service from the Services admin tool, it does what I want it to. It's just getting the service started by the program that's the problem. (The program needs the service running in order to work.) Any ideas? - Munty -- modified at 10:29 Monday 23rd July, 2007
-
Hi Pete, Thanks for the other 2 answers. They're doing what I want them to. :) Net Start doesn't work on the Vista machine I have. It gives me an "System Error 5" message. Just to note, but the "myservice.Start()" and "Net Start "myservice"" works on my XP machine. Some further information about the service. As long as I start the service from the Services admin tool, it does what I want it to. It's just getting the service started by the program that's the problem. (The program needs the service running in order to work.) Any ideas? - Munty -- modified at 10:29 Monday 23rd July, 2007