Advertisement
| Hall of Fame |
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: |
*************Code********************
Private Sub FixTXML(ByVal FileName As String)
Dim fs As FileStream = New FileStream(FileName, FileMode.Open, FileAccess.Read)
Dim sr As New StreamReader(fs)
Dim allText As String = sr.ReadToEnd
Dim sb As StringBuilder = New StringBuilder(allText)
fs.Close()
fs = Nothing
sb.Replace("TSEPWin/TSEPWin5", "TSEPWinSim/TSEPWinSim")
Dim NewFileName As String = FileName.Replace(".TXML", ".SXML")
If My.Computer.FileSystem.FileExists(NewFileName) Then My.Computer.FileSystem.DeleteFile(NewFileName)
Dim fs2 As FileStream = New FileStream(NewFileName, FileMode.OpenOrCreate)
Dim sw As StreamWriter = New StreamWriter(NewFileName, False)
sw.Write(sb.ToString)
sw.Close()
fs2.Close()
sw = Nothing
fs2 = Nothing
End Sub
************Error Details*****************
System.IO.IOException was unhandled
Message="The process cannot access the file 'C:\Stat Audits\ABC Aircraft Fabricators\ABCAccruals\ABC Accruals.SXML' because it is being used by another process."
Source="mscorlib"
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at TSEPWin.My.MyApplication.FixTXML(String FileName) in E:\TSEPWin\TSEPWin.NET\ApplicationEvents.vb:line 89
at TSEPWin.My.MyApplication.MyApplication_Shutdown(Object sender, EventArgs e) in E:\TSEPWin\TSEPWin.NET\ApplicationEvents.vb:line 69
at Microsoft.VisualBasic.ApplicationServices.ShutdownEventHandler.Invoke(Object sender, EventArgs e)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnShutdown()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at TSEPWin.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|