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
ainn roes
NA
1
5.6k
transfer data from textbox to streamreader
Apr 7 2011 7:42 AM
i am new with c#
usually i use streamreader to display data in textbox
now...i want to read data from textbox to streamreader
i use this code but nothing will display
it is no error and i can trace it
string retValue = null;
string filename = ContentBox.Text;
if (File.Exists(filename))
{
using (StreamReader fileReader = new StreamReader(filename))
{
string fileRow;
while ((fileRow = fileReader.ReadLine()) != null)
{
string[] fileDataField = fileRow.Split(new string[] { "\r\n\t", " " }, StringSplitOptions.RemoveEmptyEntries);
string ListSplitLineByLine = "";
foreach (string lineByLine in fileDataField)
{
ListSplitLineByLine += "\r\n" + lineByLine;
}
if (!String.IsNullOrEmpty(ListSplitLineByLine))
{
retValue = ListSplitLineByLine.Trim();
txtCaseInputs.Text = retValue;
GenCombItems();
}
else
{
MessageBox.Show("No data");
}
}
// Line below is not necessary. Handled by the "using" clause.
// fileReader.Close();
}
}
else
{
MessageBox.Show("File Not Found");
}
return retValue;
how can i solve this problem?can someone help me,please?
Reply
Answers (
1
)
File format is invalid for .rtf format
How to compare pdf documents