while (readIt.Peek() >= 0) {
if (line.Contains("LogObjectUsage@1000000000 : Record 50000;")) {
MessageBox.Show("Fajl ne treba da se menja");
System.IO.File.Copy(txtb_Input_Folder.Text + Path.GetFileName(fileName), txtb_Output_folder.Text + Path.GetFileName(fileName), true);
} else {
line = readIt.ReadLine();
if (line.Contains("PROPERTIES") && !line.Contains("OBJECT-PROPERTIES")) {
sb.Append(line);
nasao_prop = true;
}.........所以问题是,当它找到“LogObjectUsage@1000000000: Record 50000;”时,我在while循环中,我不知道如何转到下一行。
我被困在那条线上,我得到了无限的TextBoxes。有人能帮我吗?在我找到"LogObjectUsage@1000000000 : Record 50000;“行之后,我如何读入下一行?
发布于 2015-07-21 23:12:38
感觉就像你想先读一行,然后再检查它。你所做的是试图在工作流程中太晚地读到这一行。
while (readIt.Peek() >= 0)
{
var line = readIt.ReadLine();
if (line.Contains("LogObjectUsage@1000000000 : Record 50000;"))
{
MessageBox.Show("Fajl ne treba da se menja");
System.IO.File.Copy(txtb_Input_Folder.Text + Path.GetFileName(fileName), txtb_Output_folder.Text + Path.GetFileName(fileName), true);
}
else
{
if (line.Contains("PROPERTIES") && !line.Contains("OBJECT-PROPERTIES")) {
sb.Append(line);
nasao_prop = true;
}
.........
}
...
}https://stackoverflow.com/questions/31542870
复制相似问题