> I want to use web form to upload my file and copy the file to another
machine.
I can upload the file, but when I copy the file(file.CopyTo(".....",
true)) to another machine(map network driver), it failed(error message : login
failed......).
So.... how should I do if I want the upload file can copy to another
machine. Thanks !!
I do not know anything about webforms but I do know about .NET security.
Standard .NET security defaults not to accept any network connection.
So "file open" on a network drive will fail while on the local drive it will
succeede.
You have to tell the program that he must have access to the network too.
In C# you have an assembly.cs file and I added these (just copied and
pasted, I think that "ZoneIdentityPermission" and maybe "FileIOPermission"
would be enough)
----------------
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Runtime.InteropServices;
[assembly:SecurityPermission(SecurityAction.Request Minimum,
UnmanagedCode=true)] // Request to run unmanaged code
[assembly:FileIOPermission(SecurityAction.RequestMi nimum,
Unrestricted=true)] // Request complete File IO functionality
[assembly:RegistryPermission(SecurityAction.Request Minimum, All="*")] //
Request complet access to the registery key
[assembly:ZoneIdentityPermission(SecurityAction.Req uestMinimum,Zone=Security
Zone.NoZone)] // Request unrestricted zone
-------------------