Kamii47

I am generating a zip file then I have to move it to a folder shared on one of the system in the network.

How Can I to move a folder into shared folder on one of the system in the network in C# .net 2.0




Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Geert Verhoeven

The following line moves a file from C:\test.txt to \\LP51\c$\Test\test.txt.

System.IO.File.Move(@"c:\test.txt", @"\\lp51\c$\test\test.txt");

NOTE: Make sure you have write permissions on NTFS level as well on Share level.

Greetz,

Geert

Geert Verhoeven
Consultant @ Ausy Belgium

My Personal Blog






Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Kamii47

Thanks

Can You please let me little bit Clear about What is the difference between [write permissions on NTFS level as well on Share level]






Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Geert Verhoeven

NTFS permissions are permissions on a folder or a file.
If you share a folder you can set permissions on that share which are not the same permissions as the NTFS permissions.

Windows works with the most restrictive permissions.

For example:
NTFS permissions on C:\test = Read
Share permissions on C:\test = Write

Result = Read

Greetz,

Geert

Geert Verhoeven
Consultant @ Ausy Belgium

My Personal Blog






Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Geert Verhoeven

Additional info: http://articles.techrepublic.com.com/5100-10877_11-6152061.html

Geert Verhoeven
Consultant @ Ausy Belgium

My Personal Blog






Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Kamii47

Can Some How Could I force to copy the file where i have only Sher level write permission on the resource




Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Geert Verhoeven

You mean that you only have share permissions Then there is no way to force it. Otherwise it would be a major security leak.

Greetz,

Geert

Geert Verhoeven
Consultant @ Ausy Belgium

My Personal Blog






Re: .NET Framework Networking and Communication How to copy a file to a folder shared on the network

Kamii47

Then Can Some How I can check that do i have or not the write permission by the help of framework classes so that at the minimum i can log about the permission