F9 Group Marketing and Technology Blog

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

Entries Tagged ‘csharp411’

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

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

Visual Studio 2010 and .NET Framework 4.0 Released Today

Microsoft is releasing Visual Studio 2010, .NET Framework 4.0, and Silverlight 4 at the Visual Studio Developer Conference in Las Vegas.  VS 2010 and .NET 4 are available today, and Silverlight 4 will be available to download later this week. Read more at DevTopics >> Related posts:Visual Studio 2010 and .NET Framework 4 Release CandidateMicrosoft Related posts: Visual Studio 2010 and .NET Framework 4 Release Candidate Microsoft Unveils Visual Studio 2010 and .NET 4.0 Documentation Available for .NET Framework 4 and Visual Studio 2010

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

Programmatically Set Decimal Places

It’s easy to programmatically set the number of decimal places in a decimal, float or double that is converted to a string.  Use the ToString method with the “N” argument summed with the number of decimal places: float value = 3.1415926F; int decimalPlaces = 3; string text = value.ToString( "N" + decimalPlaces ); Note that ‘decimalPlaces’ must be greater Related posts: C# Decimal: Literals, Conversions and Formatting Having Pun with C# In C#, a string is a 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

Visual Studio 2010 and .NET 4.0 Beta 2

The second beta version of Visual Studio 2010 and Microsoft .NET Framework v4.0 are now available.  VS 2010 and .NET 4.0 deliver significant new capabilities and improvements.  The Beta 2 release was focused on performance, stability, and the integration of the overall feature set.  The development team is awaiting our feedback on the product and Related posts: Visual Studio 2010 Beta 1 Now Available for MSDN Subscribers Visual Studio "Orcas" and .NET 3.5 Beta Available 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

.NET Installed on Almost 80% of Windows PCs

The good news is that Microsoft .NET Framework is installed on a majority of Windows PCs.  The bad news is if you are developing an application with the newest version of .NET (3.5), nearly half of Windows PCs cannot run your app. Story at DevTopics Related posts:Determine Installed .NET Versions from a Web PageWindows SDK for Windows Related posts: Determine Installed .NET Versions from a Web Page Windows SDK for Windows 7 and .NET Framework 3.5 SP1: RC 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

Microsoft Sets Windows 7 Pricing and Upgrades

Microsoft has announced retail pricing for Windows 7 that includes an option to preorder the operating system at a substantial discount.  From today through July 11, U.S. consumers can preorder an upgrade from XP or Vista to Windows 7 Home premium for $49 or Windows 7 Professional for $99.  However, XP customers must do Related posts: Determine Windows Version and Edition with C# Windows SDK for Windows 7 and .NET Framework 3.5 SP1: RC Microsoft to Share .NET Framework Code

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