Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 27th, 2006, 7:45 PM   #1
NightShade01
Programmer
 
Join Date: Oct 2005
Posts: 52
Rep Power: 3 NightShade01 is on a distinguished road
user name

How would i find out what a user name is so that i might insert it to check for the validity of a file?

EX: user name is John

click a button: System.Diagnostics.Process.Start("C:\Documents and Settings\" + user + "\desktop")

Does this make sense?
NightShade01 is offline   Reply With Quote
Old Jun 27th, 2006, 7:49 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
No. Ask the user or look it up.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jun 27th, 2006, 8:49 PM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Something to think about: "Documents and Settings" and "Desktop" might change depending on the OS language and version. Windows Vista, for example, uses "Users" instead of "Documents and Settings".
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:38 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC