Prev: Speed issue creating Excel spreadsheet
Next: How can I read selected text in another application, by vb program?
From: Family Tree Mike on 31 Oct 2009 08:35 vovan wrote: > What does it mean "folder virtualization"? The file exists in reality on > the server in the location > "\\192.168.45.13\CoordData\InitialData.txt" > My program sees it and can read when it is running on XP. I can see the > file via Windows Explorer as well on both Windows XP and Windows 7. > > Thank you > vovan > Virtualization is the name for the thing that Mr. Arnold was describing as well. It protects certain folders like Program Files and My Documents, which is where I might have expected your file to reside. This only affects certain locations on your local machine, so it does not come into play in your scenario. Since it is a remote file that you know exists, it must be a permissions problem. I would have thought this would through an exception if you did not have permission to reach a file on the net. Are you running a windows forms application, or is this a windows service? Services also run differently, with different permissions on the newest OS's. -- Mike
From: vovan on 31 Oct 2009 14:19 It is Windows Form application. I've already read about permissions and tried this: objPermission = New System.Security.Permissions.FileIOPermission(Security.Permissions.PermissionState.Unrestricted, strSourse & "\InitialData.txt") objPermission.Demand() It did not sove my problem. Unfortunately I cannot find any example showing how to get permissions. I also do not understand who should have a permission - my application or my computer, and who may give that permission - the server or my application or something else. From the example I found and used (see above) it most likely that my application gives the permission to itself. If the code is correct in general (I do not know why it doesn't work) then for me it is nonsense - to give a permission to itself. Anyway, I still need a help. Thank you vovan "Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message news:ekvMQaiWKHA.1792(a)TK2MSFTNGP04.phx.gbl... > vovan wrote: >> What does it mean "folder virtualization"? The file exists in reality on >> the server in the location >> "\\192.168.45.13\CoordData\InitialData.txt" >> My program sees it and can read when it is running on XP. I can see the >> file via Windows Explorer as well on both Windows XP and Windows 7. >> >> Thank you >> vovan >> > > Virtualization is the name for the thing that Mr. Arnold was describing as > well. It protects certain folders like Program Files and My Documents, > which is where I might have expected your file to reside. This only > affects certain locations on your local machine, so it does not come into > play in your scenario. > > Since it is a remote file that you know exists, it must be a permissions > problem. I would have thought this would through an exception if you did > not have permission to reach a file on the net. Are you running a windows > forms application, or is this a windows service? Services also run > differently, with different permissions on the newest OS's. > > -- > Mike
From: Mr. Arnold on 31 Oct 2009 14:35 vovan wrote: > It is Windows Form application. > I've already read about permissions and tried this: > objPermission = New > System.Security.Permissions.FileIOPermission(Security.Permissions.PermissionState.Unrestricted, > strSourse & "\InitialData.txt") > objPermission.Demand() > It did not sove my problem. Unfortunately I cannot find any example > showing how to get permissions. > I also do not understand who should have a permission - my application > or my computer, and who may give that permission - the server or my > application or something else. > From the example I found and used (see above) it most likely that my > application gives the permission to itself. If the code is correct in > general (I do not know why it doesn't work) then for me it is nonsense - > to give a permission to itself. > Anyway, I still need a help. > Maybe, you should put the file in a FileShare and give access to the Fileshare to Everyone group. A program is going to have the the file access rights of the user account that's running the application.
From: Patrice on 31 Oct 2009 16:49 My approach would be to start from the root . I.e. do you see the container folder ? also what if you are using the computer name rather than the IP address ? What if you map a drive to this network share and see if you can see enumerate files in this folder ? Hopefully it should allow to narrow down the problem (you don't have any message, it just return false ?)... -- Patrice
From: Patrice on 3 Nov 2009 05:26 And if you enumerate files from this folder ? This is to see which kind of exception it would give. It would likely allow to distinguish between a right issue and some other problem. It's really weird it works with a mapped drive but not with an UNC path... -- Patrice
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Speed issue creating Excel spreadsheet Next: How can I read selected text in another application, by vb program? |