Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
AnswerRe: stuck in (dll registration in system32 by c#) Pin
Dave Kreskowiak10-Jun-13 1:34
mveDave Kreskowiak10-Jun-13 1:34 
Questionc# Pin
zofi519-Jun-13 20:16
zofi519-Jun-13 20:16 
AnswerRe: c# Pin
Abhinav S9-Jun-13 21:49
Abhinav S9-Jun-13 21:49 
AnswerRe: c# Pin
bfis10813710-Jun-13 0:38
bfis10813710-Jun-13 0:38 
AnswerRe: c# Pin
OriginalGriff10-Jun-13 9:09
mveOriginalGriff10-Jun-13 9:09 
QuestionHow to deal with environment variables and non admin users Pin
bfis1081379-Jun-13 2:08
bfis1081379-Jun-13 2:08 
AnswerRe: How to deal with environment variables and non admin users Pin
Eddy Vluggen9-Jun-13 5:06
professionalEddy Vluggen9-Jun-13 5:06 
GeneralRe: How to deal with environment variables and non admin users Pin
bfis1081379-Jun-13 10:30
bfis1081379-Jun-13 10:30 
The path I tried was in 2 places. First I made a folder in the c root. Then I thought it had to do with permissions so I used the public folder. This is c:\users\public on win7/vista and it's c:\documents and settings\All Users in xp. Like I said I used Application.StartupPath and it works but only when I start it myself. When it runs automatically at startup, "Application.StartupPath" points to c:\users\current user. With all that being said I found a solution. I add an environment variable which does require elevation but it's a one time thing when the app is first installed which i use a separate app to do(which i call from the main app) so as to not require the higher privilege all the time. That much I had working before. Where I got stuck was trying to retrieve the variable. It would require elevation as well which was unacceptable. However I found a solution.

I found this on another site but since I know how some sites are with links I am not going to post the link. Here is the code I used to retrieve an environment variable without elevation.

C#
string keyName = @"SYSTEM\CurrentControlSet\Control\Session Manager\Environment\";
string path = (string)Registry.LocalMachine.OpenSubKey(keyName).GetValue("variablename", "", RegistryValueOptions.DoNotExpandEnvironmentNames);

GeneralRe: How to deal with environment variables and non admin users Pin
Dave Kreskowiak9-Jun-13 13:00
mveDave Kreskowiak9-Jun-13 13:00 
GeneralRe: How to deal with environment variables and non admin users Pin
bfis1081379-Jun-13 20:25
bfis1081379-Jun-13 20:25 
GeneralRe: How to deal with environment variables and non admin users Pin
Dave Kreskowiak10-Jun-13 1:21
mveDave Kreskowiak10-Jun-13 1:21 
QuestionCrystal report login popsup why? Pin
zakirox1238-Jun-13 20:52
zakirox1238-Jun-13 20:52 
AnswerRe: Crystal report login popsup why? Pin
OriginalGriff8-Jun-13 21:59
mveOriginalGriff8-Jun-13 21:59 
GeneralRe: Crystal report login popsup why? Pin
zakirox1238-Jun-13 22:20
zakirox1238-Jun-13 22:20 
AnswerRe: Crystal report login popsup why? Pin
Abhinav S9-Jun-13 5:18
Abhinav S9-Jun-13 5:18 
QuestionSAD_1969_UTM_Zone_23S to WGS84 Coordinate convertion using C# Pin
pvt_infotech7-Jun-13 22:57
pvt_infotech7-Jun-13 22:57 
AnswerRe: SAD_1969_UTM_Zone_23S to WGS84 Coordinate convertion using C# Pin
Bernhard Hiller11-Jun-13 0:05
Bernhard Hiller11-Jun-13 0:05 
QuestionHow to sort serial no in datagridview ,c# Pin
Member 30804707-Jun-13 21:34
Member 30804707-Jun-13 21:34 
AnswerRe: How to sort serial no in datagridview ,c# Pin
Abhinav S7-Jun-13 21:40
Abhinav S7-Jun-13 21:40 
QuestionHow to use product key in my windows application. Pin
ajjuvirgo7-Jun-13 20:04
ajjuvirgo7-Jun-13 20:04 
AnswerRe: How to use product key in my windows application. Pin
Abhinav S7-Jun-13 20:50
Abhinav S7-Jun-13 20:50 
QuestionHow to validate a text box in windows form application using c#. Pin
ajjuvirgo7-Jun-13 20:03
ajjuvirgo7-Jun-13 20:03 
AnswerRe: How to validate a text box in windows form application using c#. Pin
OriginalGriff7-Jun-13 20:18
mveOriginalGriff7-Jun-13 20:18 
AnswerRe: How to validate a text box in windows form application using c#. Pin
Abhinav S7-Jun-13 20:51
Abhinav S7-Jun-13 20:51 
QuestionDoes C# have similar interrupts as embedded C Pin
Member 100880257-Jun-13 13:41
Member 100880257-Jun-13 13:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.