|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Newbie error on outputEverything works OK. When User B logs on and attempts to run a part of the program which writes to a log file, the following error comes up. I don't know where to begin. The program runs on XP in a peer-to-peer network. TIA Lars ************** Exception Text ************** System.UnauthorizedAccessException: Access to the path "E:\MH\logfile.txt" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at MailHouse.ImportAddresses.Import_Click(Object sender, EventArgs e) in T:\Powell\MailHouse\Forms\ImportAddresses.vb:line 614 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) A couple of questions:
1. Can user B edit the file manually (e.g.: open it in Notepad, make a change, then save the change)? 2. Is E: a local hard drive or a mapped drive or ??? Show quoteHide quote "larzeb" <larzeb@community.nospam> wrote in message news:3e7s21hfslkqou52lqflmq3vo7k0b14h3q@4ax.com... >I wrote a program and installed it xcopy logged onto User A. > Everything works OK. When User B logs on and attempts to run a part of > the program which writes to a log file, the following error comes up. > I don't know where to begin. > > The program runs on XP in a peer-to-peer network. > > TIA Lars > > ************** Exception Text ************** > System.UnauthorizedAccessException: Access to the path > "E:\MH\logfile.txt" is denied. > at System.IO.__Error.WinIOError(Int32 errorCode, String str) > at System.IO.FileStream..ctor(String path, FileMode mode, > FileAccess access, FileShare share, Int32 bufferSize, Boolean > useAsync, String msgPath, Boolean bFromProxy) > at System.IO.FileStream..ctor(String path, FileMode mode, > FileAccess access, FileShare share) > at MailHouse.ImportAddresses.Import_Click(Object sender, EventArgs > e) in T:\Powell\MailHouse\Forms\ImportAddresses.vb:line 614 > at System.Windows.Forms.Control.OnClick(EventArgs e) > at System.Windows.Forms.Button.OnClick(EventArgs e) > at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) > at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons > button, Int32 clicks) > at System.Windows.Forms.Control.WndProc(Message& m) > at System.Windows.Forms.ButtonBase.WndProc(Message& m) > at System.Windows.Forms.Button.WndProc(Message& m) > at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) > at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 > msg, IntPtr wparam, IntPtr lparam) > > Nicole,
I'm not on site, but I'll get an answer to the first question by tomorrow. E is a local disk. Lars On Tue, 8 Mar 2005 16:56:43 -0500, "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote: Show quoteHide quote >A couple of questions: > >1. Can user B edit the file manually (e.g.: open it in Notepad, make a >change, then save the change)? >2. Is E: a local hard drive or a mapped drive or ??? > > >"larzeb" <larzeb@community.nospam> wrote in message >news:3e7s21hfslkqou52lqflmq3vo7k0b14h3q@4ax.com... >>I wrote a program and installed it xcopy logged onto User A. >> Everything works OK. When User B logs on and attempts to run a part of >> the program which writes to a log file, the following error comes up. >> I don't know where to begin. >> >> The program runs on XP in a peer-to-peer network. >> >> TIA Lars >> >> ************** Exception Text ************** >> System.UnauthorizedAccessException: Access to the path >> "E:\MH\logfile.txt" is denied. >> at System.IO.__Error.WinIOError(Int32 errorCode, String str) >> at System.IO.FileStream..ctor(String path, FileMode mode, >> FileAccess access, FileShare share, Int32 bufferSize, Boolean >> useAsync, String msgPath, Boolean bFromProxy) >> at System.IO.FileStream..ctor(String path, FileMode mode, >> FileAccess access, FileShare share) >> at MailHouse.ImportAddresses.Import_Click(Object sender, EventArgs >> e) in T:\Powell\MailHouse\Forms\ImportAddresses.vb:line 614 >> at System.Windows.Forms.Control.OnClick(EventArgs e) >> at System.Windows.Forms.Button.OnClick(EventArgs e) >> at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) >> at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons >> button, Int32 clicks) >> at System.Windows.Forms.Control.WndProc(Message& m) >> at System.Windows.Forms.ButtonBase.WndProc(Message& m) >> at System.Windows.Forms.Button.WndProc(Message& m) >> at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) >> at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) >> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 >> msg, IntPtr wparam, IntPtr lparam) >> >> > Editing with Notepad does not allow Save. "Cannot create
E:\MH\logfile.txt" ... On Tue, 8 Mar 2005 16:56:43 -0500, "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote: Show quoteHide quote >A couple of questions: > >1. Can user B edit the file manually (e.g.: open it in Notepad, make a >change, then save the change)? >2. Is E: a local hard drive or a mapped drive or ??? > > >"larzeb" <larzeb@community.nospam> wrote in message >news:3e7s21hfslkqou52lqflmq3vo7k0b14h3q@4ax.com... >>I wrote a program and installed it xcopy logged onto User A. >> Everything works OK. When User B logs on and attempts to run a part of >> the program which writes to a log file, the following error comes up. >> I don't know where to begin. >> >> The program runs on XP in a peer-to-peer network. >> >> TIA Lars >> >> ************** Exception Text ************** >> System.UnauthorizedAccessException: Access to the path >> "E:\MH\logfile.txt" is denied. >> at System.IO.__Error.WinIOError(Int32 errorCode, String str) >> at System.IO.FileStream..ctor(String path, FileMode mode, >> FileAccess access, FileShare share, Int32 bufferSize, Boolean >> useAsync, String msgPath, Boolean bFromProxy) >> at System.IO.FileStream..ctor(String path, FileMode mode, >> FileAccess access, FileShare share) >> at MailHouse.ImportAddresses.Import_Click(Object sender, EventArgs >> e) in T:\Powell\MailHouse\Forms\ImportAddresses.vb:line 614 >> at System.Windows.Forms.Control.OnClick(EventArgs e) >> at System.Windows.Forms.Button.OnClick(EventArgs e) >> at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) >> at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons >> button, Int32 clicks) >> at System.Windows.Forms.Control.WndProc(Message& m) >> at System.Windows.Forms.ButtonBase.WndProc(Message& m) >> at System.Windows.Forms.Button.WndProc(Message& m) >> at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) >> at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) >> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 >> msg, IntPtr wparam, IntPtr lparam) >> >> > If you want user B to be able to add to the log file via your application,
he'll need write permissions to the file. You should be able to grant the user permissions to the file via Windows Explorer (right-click on file, show properties, edit access control list on the security tab) while logged in as a user with sufficient permissions (e.g.: an administrator). Given that this is happening at a client site, you may require assistance from the client's IT staff to change the permissions on the file. Show quoteHide quote "larzeb" <larzeb@community.nospam> wrote in message news:f39u21tbfvtkqrlkirip3ch411d707ej6h@4ax.com... > Editing with Notepad does not allow Save. "Cannot create > E:\MH\logfile.txt" ... > > On Tue, 8 Mar 2005 16:56:43 -0500, "Nicole Calinoiu" <calinoiu > REMOVETHIS AT gmail DOT com> wrote: > >>A couple of questions: >> >>1. Can user B edit the file manually (e.g.: open it in Notepad, make a >>change, then save the change)? >>2. Is E: a local hard drive or a mapped drive or ??? >> >> >>"larzeb" <larzeb@community.nospam> wrote in message >>news:3e7s21hfslkqou52lqflmq3vo7k0b14h3q@4ax.com... >>>I wrote a program and installed it xcopy logged onto User A. >>> Everything works OK. When User B logs on and attempts to run a part of >>> the program which writes to a log file, the following error comes up. >>> I don't know where to begin. >>> >>> The program runs on XP in a peer-to-peer network. >>> >>> TIA Lars >>> >>> ************** Exception Text ************** >>> System.UnauthorizedAccessException: Access to the path >>> "E:\MH\logfile.txt" is denied. >>> at System.IO.__Error.WinIOError(Int32 errorCode, String str) >>> at System.IO.FileStream..ctor(String path, FileMode mode, >>> FileAccess access, FileShare share, Int32 bufferSize, Boolean >>> useAsync, String msgPath, Boolean bFromProxy) >>> at System.IO.FileStream..ctor(String path, FileMode mode, >>> FileAccess access, FileShare share) >>> at MailHouse.ImportAddresses.Import_Click(Object sender, EventArgs >>> e) in T:\Powell\MailHouse\Forms\ImportAddresses.vb:line 614 >>> at System.Windows.Forms.Control.OnClick(EventArgs e) >>> at System.Windows.Forms.Button.OnClick(EventArgs e) >>> at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) >>> at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons >>> button, Int32 clicks) >>> at System.Windows.Forms.Control.WndProc(Message& m) >>> at System.Windows.Forms.ButtonBase.WndProc(Message& m) >>> at System.Windows.Forms.Button.WndProc(Message& m) >>> at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) >>> at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) >>> at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 >>> msg, IntPtr wparam, IntPtr lparam) >>> >>> >> >
Other interesting topics
Running programs located on server
why i get UnauthorizedAccess Exception? get remote server's SSL public key .NET thin control & IE Single-sign-on .NET GUI to J2EE server WinForms App Security Error PrincipalPermission.Demand() returns: Request for principal permission failed Assymetric encryption - building an interopable solution that works with .NET/Java/OpenSSL error when I use AES with CAPICOM Windows Control Library call to Web Service over LAN fails |
|||||||||||||||||||||||