F9 Group Marketing and Technology Blog

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

Entries Tagged ‘csharp411.com’

Type Name “UITypeEditor” Not Found

This is one of those “D’oh!” moments.  You’re creating your own UITypeEditor.  You know the UITypeEditor class is located in the System.Drawing.Design namespace.  So naturally you want to add to your Visual Studio project a reference to the System.Drawing.Design.dll, right?  Wrong!  When you compile your project, the following error may appear: The type or namespace name Related posts: Adding Assemblies to the Visual Studio "Add Reference" Dialog Web Service Stumper: “Ambiguous Type” IEventHandlerService Already Exists in the Service Container

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

C# Convert Byte Array to String

It’s easy to convert a byte array to a string.  For an ASCII string, use the Encoding.ASCII.GetString static method: byte[] buffer = new byte[10]; // todo: populate the buffer with string data string s = Encoding.ASCII.GetString( buffer ); Related posts:Convert String to Byte ArrayC# Convert String to Stream, and Stream to StringRead File into Byte Array Related posts: Convert String to Byte Array C# Convert String to Stream, and Stream to String Read File into Byte Array

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

Read File into Byte Array

It’s easy to read a file into a byte array.  Just use the File.ReadAllBytes static method.  This opens a binary file in read-only mode, reads the contents of the file into a byte array, and then closes the file. string filePath = @"C:test.doc"; byte[] byteArray = File.ReadAllBytes( filePath ); Related posts:C# Read Text File Line-by-LineConvert String Related posts: C# Read Text File Line-by-Line Convert String to Byte Array C# Read Text File into String

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

Visual Studio 2010 and .NET Framework 4 Release Candidate

The Release Candidate (RC) for Visual Studio 2010 and .NET Framework 4.0 is now available to the public.  The biggest change from Beta 2 is a major improvement to Visual Studio performance, specifically as it relates to loading solutions, typing, building and debugging.  The RC includes a “go-live license” for companies that wish to deploy Related posts: Visual Studio 2010 and .NET 4.0 Beta 2 Documentation Available for .NET Framework 4 and Visual Studio 2010 Visual Studio 2010 Beta 1 Now Available for MSDN Subscribers

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

Visual Studio 2010 Tip of the Day

Zain Naboulsi, a Senior Developer Evangelist at Microsoft, has started the “Tip of the Day” series for Visual Studio 2010, taking the reins from Sara Ford. Visual Studio 2010 Tip of the Day Related posts:Microsoft Unveils Visual Studio 2010 and .NET 4.0Visual Studio 2010 Beta 1 Now Available for MSDN SubscribersVisual Studio 2010 and .NET 4.0 Beta Related posts: Microsoft Unveils Visual Studio 2010 and .NET 4.0 Visual Studio 2010 Beta 1 Now Available for MSDN Subscribers Visual Studio 2010 and .NET 4.0 Beta 2

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

Free Microsoft Software from WebsiteSpark

Microsoft has launched a new WebsiteSpark program for independent Web developers and companies that build Web applications and Web sites for others.  The program enables qualified developers to receive FREE software, support and business resources from Microsoft for three years.  The purpose is to help independent Web developers expand their business and build great Web Related posts: Free Developer Tools Microsoft to Share .NET Framework Code Microsoft Unveils Visual Studio 2010 and .NET 4.0

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

Silverlight 3 Released

Silverlight is a Web application development framework similar to Adobe Flash.  Microsoft has just released Silverlight 3, a major update that delivers many new features including: Hardware graphics acceleration, which lowers CPU usage and enables 1080p HD video over the Web. Support for H.264 video, AAC audio and MPEG-4 content. Smooth media streaming over HTTP. 3D-perspective Related posts: Visual Studio 2008 and .NET 3.5 Released Visual Studio 2008 and .NET 3.5 Service Pack 1 Released Visual Studio "Orcas" and .NET 3.5 Beta Available

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