Windows应用程序如何从客户端使用C#4.0如何从客户端使用C#4.0
Windows应用程序读取文本文件在服务器和客户端应用程序中的文本框显示相同的阅读文本文件在服务器
能够在本地读取文本并在文本框中打印相同
但是来自服务器怎么办?
下面是我尝试了本地文件
string line;
StringBuilder sb = new StringBuilder();
int counter = 0;
using (StreamReader file = new StreamReader(path))
{
while ((line = file.ReadLine()) != null)
{
if (line.Contains(searchstring))
{
if (line.Contains(searchfromdate)) //|| line.Contains(searchtodate))
{
sb.AppendLine(line.ToString());
counter++;
}
}
}
}
ResultTextBox.Text = sb.ToString();
CountLabel.Text = counter.ToString();
感谢Martyn Weber你的回答有效!!!!! – kumartyr