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