Best way for retrieve specific directory

Best way for retrieve specific directory

Anonymous
Not applicable
500 Views
1 Reply
Message 1 of 2

Best way for retrieve specific directory

Anonymous
Not applicable

i want to retrieve the Desktop Directory but i found 2 way :

 

1 : Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)

2 : My.Computer.FileSystem.SpecialDirectories.Desktop

 

so.. what is the best ? And why 2 choose for this ? I am confused...

 

0 Likes
501 Views
1 Reply
Reply (1)
Message 2 of 2

Ed__Jobe
Mentor
Mentor

VB provides the My object. It just wraps the environment (as well as other parts of the CLR), which you could access directly if you want. The My object is not available in C#.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes