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
iiDrkness iiDrkness
NA
3
393
I am trying to make something that opens a file doesn't work
Mar 2 2019 8:12 PM
I am trying to make a program that opens text files and shows the text but I get an error saying that ExecuteBox does not contain a definition for text. Please help!!! Code below
void OpenFile_Click(object sender, EventArgs e)
{
Stream myStream;
OpenFileDialog OpenTxtFile = new OpenFileDialog();
void OpenFile_Click(object sender, EventArgs e)
{
OpenTxtFile.Filter = "Text|*.txt";
if (OpenTxtFile.ShowDialog() == DialogResult.OK)
{
ExecuteBox.Text = OpenTxtFile.FileName;
//FileName.Text = OpenTxtFile.SafeFileName; -- Shows file name good for multiple tabs.
if ((myStream = OpenTxtFile.OpenFile()) != null)
{
string strfilename = OpenTxtFile.FileName;
string filetext = File.ReadAllText(strfilename);
ExecuteBox.Text = filetext;
}
}
}
}
Reply
Answers (
1
)
if dateTime is datatype used in database
How to get audio fingerprint in c#.?