TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mayur Gujrathi
409
3.9k
1m
Creating and writting file
Dec 20 2011 7:41 AM
string path = "C:\\mytest.txt";
if (File.Exists(path))
{
File.Delete(path);
}
using (FileStream fs = File.Create(path))
{
//fs.Close();
// fs.CanWrite = true;
TextWriter sw = new StreamWriter("C:\\mytest.txt");//error is coming here
sw.WriteLine("ddd", "dddd", "dsdsd");
--------------
-------------
--------
}
I am trying to create and write to text file but is giving error file is being used by another person
Reply
Answers (
3
)
Queue's
Designing a Console Editor