Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
Can't create a text file in C#
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Osayz Family
11y
1.2k
1
Reply
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();
}
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
System.AggregateException
Change ListBox ScrollBar Color in c#