PC Review


Reply
Thread Tools Rate Thread

My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData in Csharp?

 
 
Pieter
Guest
Posts: n/a
 
      3rd Apr 2006
Hi,

What's the equivalent in C# for
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData (from
VB.NET)? I noticed that there isn't something like the My-object in C#? Or
is there?

What I need in this case is this: C:\Documents and
Settings\MyUserName\Application Data\MyCompany\Myapplication\1.0.0.0

But it would be great if I had a general solution that gives me (most) of
the My-object in Csharp :-)

Thanks a lot in advance,

Pieter


 
Reply With Quote
 
 
 
 
Vadym Stetsyak
Guest
Posts: n/a
 
      3rd Apr 2006
Hello, Pieter!

P> What's the equivalent in C# for
P> My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
P> (from VB.NET)? I noticed that there isn't something like the My-object
P> in C#? Or is there?

You can use Environment.GetFolderPath(SpecialFolder.ApplicationData)

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Reply With Quote
 
Pieter
Guest
Posts: n/a
 
      3rd Apr 2006
Ok! Thanks a lot!

"Vadym Stetsyak" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> You can use Environment.GetFolderPath(SpecialFolder.ApplicationData)



 
Reply With Quote
 
Matt Dunn
Guest
Posts: n/a
 
      3rd Apr 2006
Greetings Pieter,

Assuming you are implementing a WinForms application, you can also use
Application.LocalUserAppDataPath and Application.UserAppDataPath static
properties to retrieve the same value (the Application class is defined
in the System.Windows.Forms namespace).

However, note that you may have problems in future if use the
AssemblyInformationalVersion attribute in combination with these
properties, see the following article for more information:

http://mattonsoftware.com/archive/2006/02/25/6.aspx

Cheers,
Matt

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData SurturZ Microsoft VB .NET 0 10th Jul 2008 07:30 AM
Bug in My.Computer.FileSystem.WriteAllText =?Utf-8?B?Qm8gTWNJbHZhaW4=?= Microsoft Dot NET Framework 3 17th Aug 2007 08:34 AM
Help with My.Computer.FileSystem? Jesse Microsoft VB .NET 1 12th Feb 2007 05:39 PM
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData in Csharp? Pieter Microsoft Dot NET Framework 3 3rd Apr 2006 02:02 PM
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData in Csharp? Pieter Microsoft C# .NET 3 3rd Apr 2006 02:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:00 PM.