I have two computers connected to a wireless network with no password.
The files are on computer A and the program is on computer B.
From the OS I can access and modify the files in A from B with no problem:
And when I run the program:
using (StreamReader sr = new StreamReader("\\\\VIERNES7-3\\Documentos c\\tables\\tableOrders"))
{
String line;
while ((line = sr.ReadLine()) != null)
{
activeTables.Add(int.Parse(line));
}
}
It gives me the following exception:
No se controló System.UnauthorizedAccessException
Message=Access to the path '\\VIERNES7-3\Documentos c\tables\tableOrders' is denied.
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, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path)
at cocina2.Table.ActiveTables() in C:\Users\Trufa\documents\visual studio 2010\Projects\Viernes 7\cocina2\Table.cs:line 16
at cocina2.Form1.paintListViews() in C:\Users\Trufa\documents\visual studio 2010\Projects\Viernes 7\cocina2\Form1.cs:line 46
at cocina2.Form1.refresh() in C:\Users\Trufa\documents\visual studio 2010\Projects\Viernes 7\cocina2\Form1.cs:line 247
at cocina2.Form1..ctor() in C:\Users\Trufa\documents\visual studio 2010\Projects\Viernes 7\cocina2\Form1.cs:line 23
at cocina2.Program.Main() in C:\Users\Trufa\Documents\Visual Studio 2010\Projects\Viernes 7\cocina2\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
I'm not sure what is the problem since I seem to be authorized.