我在這裏寫入一個文本file..I我在SQL文件中搜索一個關鍵字Raiserror
如果該關鍵字存在,我必須寫該行..通過使用C#修改某些字符來寫入文本文件?
它寫像
LineNo : 66 : raiserror ('Sequence number cannot be blank',16,1)
但我需要只寫
LineNo : 66 : Sequence number cannot be blank
這是possible..If所以如何修剪.. 這裏是我的代碼
while ((line = file.ReadLine()) != null)
{
if (line.IndexOf("Raiseerror", StringComparison.CurrentCultureIgnoreCase) != -1)
{
dest.WriteLine("LineNo : " + counter.ToString() + " : " + " " + line.TrimStart());
}
counter++;
}
file.BaseStream.Seek(0, SeekOrigin.Begin);
counter = 1;
有何建議?
在sql文件它會像raiserror('序列號不能爲空',16,1)只...正在寫行numnber使用計數器 – bala3569 2011-05-19 14:50:40
請參閱編輯。這與Stecya是一回事,但只有一行。 – 2011-05-19 14:53:42
嘗試urs ..工作表示感謝 – bala3569 2011-05-19 17:06:12