User Id :    Password :      New Member   Forgot Password  
 
How to create file in csharp
Description In this code snippet I will show you how to create file in csharp.   No. of Views     3374
  Rating     4
Author Najmul Hoda   Posted On     18 Oct 2010
Tags ASP.NET,C#    

Sample Code   Download Code

In this code snippet I will show you how to create file in csharp.

string strpath = @"c:\myFolder\Test.txt";
// Create the file.
FileStream fs = File.Create(strpath, 1024); 
// Add some information to the file.
 Byte[] info = new UTF8Encoding(true).GetBytes("File created by Najmul.");
fs.Write(info, 0, info.Length);
fs.Close();

Enjoy coding............

About Author

About Author He is a team lead, having 8+ years of experience. He loves writing technical article for .Net developers. Najmul Hoda
No Photo
 
Country United States
Company BirlaSoft
Home Page http://www.magixchat.com

Rate this article

Rating options from poor, fair, good, very good to excelent.  
 

Comments

   
Write your comment here.
Comment
Verification Code