Click here to Skip to main content
15,888,113 members
Home / Discussions / C#
   

C#

 
AnswerRe: How exactly is locking performed with IIS and a web.config? Pin
Richard Deeming3-Apr-19 0:11
mveRichard Deeming3-Apr-19 0:11 
QuestionWhat are the settings I need to have in order to run debug in Visual Studio for a program set up in the IIS? Pin
Xarzu2-Apr-19 9:51
Xarzu2-Apr-19 9:51 
AnswerRe: What are the settings I need to have in order to run debug in Visual Studio for a program set up in the IIS? Pin
Ron Nicholson2-Apr-19 11:02
professionalRon Nicholson2-Apr-19 11:02 
QuestionRDLC Report with nested row groups Pin
Member 140571372-Apr-19 8:28
Member 140571372-Apr-19 8:28 
QuestionUpdate User Environment Variable Pin
DavPCode2-Apr-19 4:50
DavPCode2-Apr-19 4:50 
AnswerRe: Update User Environment Variable Pin
OriginalGriff2-Apr-19 5:50
mveOriginalGriff2-Apr-19 5:50 
GeneralRe: Update User Environment Variable Pin
DavPCode2-Apr-19 7:12
DavPCode2-Apr-19 7:12 
GeneralRe: Update User Environment Variable Pin
Richard Deeming2-Apr-19 8:06
mveRichard Deeming2-Apr-19 8:06 
According to the source, the SetEnvironmentVariable method broadcasts the WM_SETTINGCHANGE message for you:
C#
// send a WM_SETTINGCHANGE message to all windows
IntPtr r = Win32Native.SendMessageTimeout(new IntPtr(Win32Native.HWND_BROADCAST), Win32Native.WM_SETTINGCHANGE, IntPtr.Zero, "Environment", 0, 1000, IntPtr.Zero);
if (r == IntPtr.Zero) BCLDebug.Assert(false, "SetEnvironmentVariable failed: " + Marshal.GetLastWin32Error());

If target is EnvironmentVariableTarget.User, the environment variable is stored in the HKEY_CURRENT_USER\Environment key of the local computer's registry. It is also copied to instances of File Explorer that are running as the current user. The environment variable is then inherited by any new processes that the user launches from File Explorer.
...
If target is User or Machine, other applications are notified of the set operation by a Windows WM_SETTINGCHANGE message.

I suspect the problem is that you're calling this from a login script. This Technet post[^] seems to suggest that the message has to be broadcast after the login script has finished.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Update User Environment Variable Pin
DavPCode2-Apr-19 12:07
DavPCode2-Apr-19 12:07 
QuestionValues Sum in a file Pin
Member 1420343029-Mar-19 10:46
Member 1420343029-Mar-19 10:46 
AnswerRe: Values Sum in a file Pin
OriginalGriff29-Mar-19 21:21
mveOriginalGriff29-Mar-19 21:21 
AnswerRe: Values Sum in a file Pin
Member 1420343030-Mar-19 3:29
Member 1420343030-Mar-19 3:29 
AnswerRe: Values Sum in a file Pin
BillWoodruff31-Mar-19 19:25
professionalBillWoodruff31-Mar-19 19:25 
QuestionSplit lines in a file Pin
Member 1420343029-Mar-19 8:34
Member 1420343029-Mar-19 8:34 
AnswerRe: Split lines in a file Pin
OriginalGriff29-Mar-19 9:11
mveOriginalGriff29-Mar-19 9:11 
QuestionException while trying reading a local file using online compiler Pin
Member 1420343029-Mar-19 6:28
Member 1420343029-Mar-19 6:28 
AnswerRe: Exception while trying reading a local file using online compiler Pin
OriginalGriff29-Mar-19 6:42
mveOriginalGriff29-Mar-19 6:42 
GeneralRe: Exception while trying reading a local file using online compiler Pin
Member 1420343029-Mar-19 7:19
Member 1420343029-Mar-19 7:19 
GeneralRe: Exception while trying reading a local file using online compiler Pin
OriginalGriff29-Mar-19 7:23
mveOriginalGriff29-Mar-19 7:23 
GeneralRe: Exception while trying reading a local file using online compiler Pin
Dave Kreskowiak29-Mar-19 9:44
mveDave Kreskowiak29-Mar-19 9:44 
GeneralRe: Exception while trying reading a local file using online compiler Pin
Member 1420343029-Mar-19 10:48
Member 1420343029-Mar-19 10:48 
QuestionGetting exception message "Incorrect syntax near '(' " in C# web app Pin
Member 1420265628-Mar-19 20:10
Member 1420265628-Mar-19 20:10 
AnswerRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
GenJerDan28-Mar-19 20:58
GenJerDan28-Mar-19 20:58 
AnswerRe: Getting exception message "Incorrect syntax near '(' " in C# web app Pin
OriginalGriff28-Mar-19 21:04
mveOriginalGriff28-Mar-19 21:04 
AnswerRe: Getting exception message "Incorrect syntax near '(' " in C# web app PinPopular
Luc Pattyn28-Mar-19 23:39
sitebuilderLuc Pattyn28-Mar-19 23:39 

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.