drsina
سه شنبه 14 آبان 1392, 18:09 عصر
سلام
شاید سوالم درست نباشه ، ولی میشه کل یک فایل تکست رو رووی یه متغیر string ریخت ؟!
کاری که من کردم اینه :
StreamReader sr = new StreamReader(Environment.CurrentDirectory + @"\Log.txt");
string line = sr.ReadLine();
while (line != null)
{
string temp = richTextBox1.Text;
richTextBox1.Text =temp + line;
line = sr.ReadLine();
}
MessageBox.Show(richTextBox2.Text);
حالا جواب نمیده !!! :لبخند:
به نظرتون بهتر راه برای اینکار چیه ؟!
یه متد تبدیل string به باینری دارم ، حالا میخوام ، به عنوان آرگومان محتویات یه فایل رو ارسال کنم.
شاید سوالم درست نباشه ، ولی میشه کل یک فایل تکست رو رووی یه متغیر string ریخت ؟!
کاری که من کردم اینه :
StreamReader sr = new StreamReader(Environment.CurrentDirectory + @"\Log.txt");
string line = sr.ReadLine();
while (line != null)
{
string temp = richTextBox1.Text;
richTextBox1.Text =temp + line;
line = sr.ReadLine();
}
MessageBox.Show(richTextBox2.Text);
حالا جواب نمیده !!! :لبخند:
به نظرتون بهتر راه برای اینکار چیه ؟!
یه متد تبدیل string به باینری دارم ، حالا میخوام ، به عنوان آرگومان محتویات یه فایل رو ارسال کنم.