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
Osayz Family
NA
7
4.6k
Can't create a text file in C#
Aug 12 2013 5:52 AM
My app has a Login Form.
Following code which I created a text file is not correct. I don't know why.
Error is Access denied in C:\Windows\Apple.txt
And i want this text file to log usernames when user changed his username
Please help me with correct code.
thx C-SharpCorner guys......
using System.IO;
string fileLocation = @"C:\Windows\Apple.txt";
if (!File.Exists(fileLocation))
{
FileStream xFile = new FileStream(fileLocation, FileMode.CreateNew);
StreamWriter sw = new StreamWriter(xFile);
sw.Write(this.txtUsername.Text);
sw.Close();
}
Reply
Answers (
3
)
method overloading
Is MVC Prominent?