Aug 5, 2004 #1 iis6newbie Technical User Joined Nov 22, 2003 Messages 54 Location US Hello all, can you give a me function name that I can use to get the %userprofile% (user's path) in C#? Thanks
Hello all, can you give a me function name that I can use to get the %userprofile% (user's path) in C#? Thanks
Aug 6, 2004 #2 chiph Programmer Joined Jun 9, 1999 Messages 9,878 Location US Use Environment.GetFolderPath, passing in one of the SpecialFolder enumeration values. Chip H. ____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first Upvote 0 Downvote
Use Environment.GetFolderPath, passing in one of the SpecialFolder enumeration values. Chip H. ____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first
Sep 13, 2004 Thread starter #3 iis6newbie Technical User Joined Nov 22, 2003 Messages 54 Location US Thanks, I found the solution. <SCRIPT LANGUAGE=VBScript> Dim sMyDocumentsFolder,wshShell Set WshShell = CreateObject("Wscript.Shell") 'Get My Documents Folder sMyDocumentsFolder = WshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Local Settings\Temporary Internet Files\" document.write sMyDocumentsFolder msgBox(sMyDocumentsFolder) </SCRIPT> Upvote 0 Downvote
Thanks, I found the solution. <SCRIPT LANGUAGE=VBScript> Dim sMyDocumentsFolder,wshShell Set WshShell = CreateObject("Wscript.Shell") 'Get My Documents Folder sMyDocumentsFolder = WshShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Local Settings\Temporary Internet Files\" document.write sMyDocumentsFolder msgBox(sMyDocumentsFolder) </SCRIPT>
Sep 13, 2004 #4 chiph Programmer Joined Jun 9, 1999 Messages 9,878 Location US Uhh, that's VBScript, not C#, like you specified in your earlier post. Chip H. ____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first Upvote 0 Downvote
Uhh, that's VBScript, not C#, like you specified in your earlier post. Chip H. ____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first
Sep 13, 2004 Thread starter #5 iis6newbie Technical User Joined Nov 22, 2003 Messages 54 Location US You are right. My fault Upvote 0 Downvote