I am trying to use File.Move to move a file from one UNC location to another. This explodes if the UNC path for the destination is a local machine (error: path access denied). An example File.Move(@"\\someServer\path\file.txt", @"\\blah2\somewhere\file.txt"). This assumes that there is a network resource named \\ someServer, and the name of my local machine is blah2. Change \\ blah2 to C: \ and all is well.
File.Move(@"\\someServer\path\file.txt", @"\\blah2\somewhere\file.txt")
Maybe this is a typo, but it should not be @"\\blah2\somewhere\file.txt", i.e. with two backslashes?
@"\\blah2\somewhere\file.txt"
Shouldn't the server name in your path start with two abbreviations?e.g. @ "\\ someServer \ path \ file.txt"
Windows , ( ACL) - . , C $, , , , , "" " ".
, , " " → " ", , . "" → " " → " " → " " .
. , - ? UNC- ?
I had the same problem and the file was locked by another program (Windows Explorer), in my case I unlocked the file using unlocker. this happened to me when accessing a file using a UNC path. The File.Move method works with access to it through the local path.
It seems to me that I did not get this behavior when manually renaming a file via UNC / local path.
File.Move file path does not accept UNC path
http://support.microsoft.com/KB/112744
Source: https://habr.com/ru/post/1698179/More articles:How to parallelize string search in a file using fork? (GNU Linux / g ++) - c ++What is the best way to open an existing project? - c #What is the percentage of code coverage for your project? - unit-testingКакие возможности доступны для разработки интерфейсов с интерфейсом межплатформенного интерфейса? - user-interfaceHow to update contacts in Zimbra using scripts? - scriptingExchange each pair of characters in a string - stringDo you have two forms per page with ASP.NET MVC? - .netAny open websites? - open-sourceHow can I get root access to a Mac OS X system without wiping the OS? - securityhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1698184/whats-the-easiest-waybest-tutorials-to-get-familiar-with-sqlalchemy&usg=ALkJrhgGWIqHFH2Z-3zH1dnDf4v_zE2bsgAll Articles