2
我想檢查文件是否存在。如果不是創建並寫入內容。是越來越創建的文件,但沒有更新和獲取錯誤消息說,它正被另一個進程如何避免文件被另一個進程在vb.net中使用
代碼片段:
Public shared sub MyXml()
If Not System.IO.File.Exists("configfile.xml") Then
Dim writer As New System.Xml.XmlTextWriter(fullPath.ToString + "\configfile.xml", Nothing)
End If
Dim xmlElement As New XElement("FilePath", ConfigWindow.Datapath.Text)
System.IO.File.WriteAllText(fullPath + "\configfile.xml", xmlElement.ToString())
end sub()
任何建議,請...
謝謝。它的工作現在很好 – Ram 2011-05-27 11:00:30
@Ram:不用客氣:-) – 2011-05-27 11:08:35