Re: File.Copy

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On 24 Nov, 10:01, Peter Duniho <NpOeStPe...@xxxxxxxxxxxxxxxx> wrote:
On 2007-11-24 00:18:12 -0800, r...@xxxxxxxxxxx said:

Hello,

Can anyone help with this?

I am using C# with IIS 6.0 on Windows 2003 Server. I am trying to copy
a file over the network. It is attempting to copy a file on a NAS
(external hard drive), which is Linux based. I have already set the
permission on the NAS and I can copy files manually without any
problem. If I run the same code on IIS 5.1 on Windows XP on the same
network, it works!

When you are testing it on the other system, are you using the same
exact user ID and password?

The exception looks like a straight permissions problem. Windows file
security can be kind of quirky, so it's hard to say exactly without
more information what a precise solution to a permissions problem would
be (depending on the configuration of the network, you might need to
have an exact NT domain account, or just log in with the right username
and password, or provide the necessary credentials via "net use",
or...).

But as a general rule, if you've got a system from which you can access
the file, and one from which you can't, it's possible that you're just
using different credentials on each system. Use the same working set
of credentials on both, and it should work.

Of course, this means it doesn't really have anything to do with the C#
code per se. But close enough. :)

Pete

Nope, imho u are providing the poor machine an URL.... llose the @ or
format the code correct

In the context of strings, the @ symbol is used to create verbatim
string literals. The @ symbol tells the string constructor to use the
string literal that follows it "literally"--even if it includes escape
characters or spans multiple lines.

This comes in handy when working with directory paths (without the @,
you would have to double each backslash). For example, the following
two strings are equivalent:

string noat = "\\\\BIGSERVER\\C";
string withat = @"\\BIGSERVER\C";

//CY
.



Relevant Pages

  • Re: File.Copy
    ... a file over the network. ... It is attempting to copy a file on a NAS ... using different credentials on each system. ... In the context of strings, the @ symbol is used to create verbatim ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: XP not reporting free/used/capacity space on a NAS
    ... One USB 2.0 device port for connection to host PC ... One 10/100 Ethernet port for connection to network ... Network Attached Storage (NAS) ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: cached login credentials
    ... , it takes longer to investigate an attack and clean up after it than it does simply to nuke-and-pave, flatten-and-rebuild, whatever. ... then over time through precision monitoring of network ... Anything that does an interactive logon will store cached credentials, ... > domain admin account credentials), is a credential cached anywhere for> the ...
    (microsoft.public.windowsxp.security_admin)
  • Re: cached login credentials
    ... administrator accounts is a good mitigation. ... then over time through precision monitoring of network ... you have a way to limit exposure to this sort of expanded attack originating ... Anything that does an interactive logon will store cached credentials, ...
    (microsoft.public.windowsxp.security_admin)
  • Re: How do you wintrolls...
    ... the system will automatically log in with those credentials from then on. ... account credentials, exactly what files do you think he wants to access? ... When Vista asks you if a newly discovered network is 'Public' or 'Private', this is one of the things it is doing. ... I have not found any necessary functionality in the menu bar; as far as I can see the only the functions that are in the menu bar are the greybeard switch for the old-style status bar and, oddly, the 'Invert Selection' command- which strictly speaking can always by done manually. ...
    (comp.sys.mac.advocacy)