-3
Im 사용 #C.다른 프로세스에서 사용중인 파일
[Henry 2014-11-26 21:10:45] ERROR: System.IO.IOException: Kan geen toegang krijg
en tot het bestand C:\Users\Jonathan\Desktop\HatBot\Bin\Debug\trades.txt omdat h
et wordt gebruikt door een ander proces.
bij System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bij 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, Boole
an useLongPath, Boolean checkHost)
bij System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
bij SteamBot.SimpleUserHandler.OnMessage(String message, EChatEntryType type)
in c:\Users\Jonathan\Desktop\HatBot\SteamBot\SimpleUserHandler.cs:regel 160
bij SteamBot.Bot.<HandleSteamMessage>b__9(FriendMsgCallback callback) in c:\U
sers\Jonathan\Desktop\HatBot\SteamBot\Bot.cs:regel 498
bij SteamKit2.CallbackMsg.Handle[T](Action`1 handler)
bij SteamBot.Bot.HandleSteamMessage(CallbackMsg msg) in c:\Users\Jonathan\Des
ktop\HatBot\SteamBot\Bot.cs:regel 488
bij SteamBot.Bot.BackgroundWorkerOnDoWork(Object sender, DoWorkEventArgs doWo
rkEventArgs) in c:\Users\Jonathan\Desktop\HatBot\SteamBot\Bot.cs:regel 826
[Henry 2014-11-26 21:10:45] ERROR: System.IO.IOException: Kan geen toegang krijg
en tot het bestand C:\Users\Jonathan\Desktop\HatBot\Bin\Debug\trades.txt omdat h
et wordt gebruikt door een ander proces.
bij System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bij 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, Boole
an useLongPath, Boolean checkHost)
bij System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
bij SteamBot.SimpleUserHandler.OnMessage(String message, EChatEntryType type)
in c:\Users\Jonathan\Desktop\HatBot\SteamBot\SimpleUserHandler.cs:regel 160
bij SteamBot.Bot.<HandleSteamMessage>b__9(FriendMsgCallback callback) in c:\U
sers\Jonathan\Desktop\HatBot\SteamBot\Bot.cs:regel 498
bij SteamKit2.CallbackMsg.Handle[T](Action`1 handler)
bij SteamBot.Bot.HandleSteamMessage(CallbackMsg msg) in c:\Users\Jonathan\Des
ktop\HatBot\SteamBot\Bot.cs:regel 488
bij SteamBot.Bot.BackgroundWorkerOnDoWork(Object sender, DoWorkEventArgs doWo
rkEventArgs) in c:\Users\Jonathan\Desktop\HatBot\SteamBot\Bot.cs:regel 826
일 : 내가
TextWriter tw = new StreamWriter("trades.txt");
// write a line of text to the file
tw.WriteLine(DateTime.Now);
// close the stream
tw.Close();
을 할 경우이 파일이 다른 프로세스에서 사용되는 오류가 발생합니까? 내가 줄 지어 줄 명령을 갖고 싶다. 그러나 이것은이
using System.IO;
using(FileStream fileStream = new FileStream(@"c:\trades.txt", FileMode.Open))
{
fileStream.Write(DateTime.Now.ToString());
fileStream.Flush();
}
는 (은'세척을 발행 시도가 – MethodMan
다른 프로세스가 파일을 잠근 것처럼 보입니다. –