我是New C in,
我正在使用messagebox来显示该行.但是它处于一个循环中,所以消息框显示的次数我想只显示一次,并且下次不应显示消息框.
try{
using (var sr = File.OpenText("test.txt")){
string newone = 20110501;//date
string line;
while ((line = sr.ReadLine()) != null){
if (three => one){
MessageBox.Show("Buy : " + line);
//Its Displaying more than 50 times i want to displayit only
//onetime and should dispose for the next Time
}
}
}
} catch { }
Run Code Online (Sandbox Code Playgroud)
提前致谢.