F9 Group Marketing and Technology Blog

Marketing, Technology, and current news at http://www.f9group.com/

Entries Tagged ‘folder’

Get Temporary Directory

To get the path of the current user’s temporary folder, call the GetTempPath method in the System.IO namespace: string tempPath = System.IO.Path.GetTempPath(); On Windows Vista and 7, this method will return the following path: C:UsersUserNameAppDataLocalTemp Related posts:C# Copy Folder RecursivelyCheck Valid File Path in C#Microsoft Sets Windows 7 Pricing and Upgrades Related posts: C# Copy Folder Recursively Check Valid File Path in C# Microsoft Sets Windows 7 Pricing and Upgrades

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

Set InitialDirectory for FolderBrowserDialog

The .NET FolderBrowserDialog class does not have an InitialDirectory property like the OpenFileDialog class.  But fortunately, it’s quite easy to set an initial folder in the FolderBrowserDialog: FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.RootFolder = Environment.SpecialFolder.Desktop; dialog.SelectedPath = @"C:Program Files"; if (dialog.ShowDialog() == DialogResult.OK) { Console.WriteLine( dialog.SelectedPath ); } Note that you can choose other RootFolder’s like MyComputer and MyDocuments.  Related posts: Adding Assemblies to the Visual Studio "Add Reference" Dialog Console Output from a WinForms Application The Proper Way to Show the Wait Cursor

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz

IEventHandlerService Already Exists in the Service Container

If you encounter this warning while compiling a Windows Form application in Visual Studio: The service System.Windows.Forms.Design.IEventHandlerService already exists in the service container. Parameter name: serviceType The solution is not very obvious, and the help provides no guidance.  After a little experimenting, I discovered an easy solution: Exit Visual Studio. Open Explorer, and navigate to the folder Related posts: Visual Studio 2008 and .NET 3.5 Service Pack 1 Released Adding Assemblies to the Visual Studio "Add Reference" Dialog Web Service Stumper: “Ambiguous Type”

Share and Enjoy:
  • Digg
  • Google
  • del.icio.us
  • Technorati
  • Facebook
  • MySpace
  • TwitThis
  • Blogsvine
  • description
  • E-mail this story to a friend!
  • Ping.fm
  • Print this article!
  • Slashdot
  • Yahoo! Buzz