473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

File.Move UNC

I'm having all sorts of problems trying to move a file across the network using the File.Move command with a computer on the network. I have tried doing it with \\<server>\<share> and I tried mapping a drive but I still get the same error.

System.UnauthorizedAccessException: Access to the path "M:\home.wav" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.File.Move(String sourceFileName, String destFileName)
at WatchFolder.Form1.ProtectandServe(String fp) in c:\files\c#\vmwatcher\form1.cs:line 147

line 147 is

File.Move(fp,sp);

where fp =c:\wavs\home.wav
and
sp = m:\home.wav or
\\w2k3\messages\home.wav

--------------------------------
From: Bill Young

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>tYTLyk4+F0Olo8XWQ4Un0A==</Id>
Nov 22 '05 #1
2 2335
Bill
What "user context" is the application running in? Is this an ASP.NET application? You are running into a permissions issue (duh, I know.) but the hard part is figuiring out what permissions need to be granted and to whom. You might try authentication.assert but this carries some consequences for security as well..

HTH

Cos Callis, MCAD
Nov 22 '05 #2
Bill
What "user context" is the application running in? Is this an ASP.NET application? You are running into a permissions issue (duh, I know.) but the hard part is figuiring out what permissions need to be granted and to whom. You might try authentication.assert but this carries some consequences for security as well..

HTH

Cos Callis, MCAD
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bmgz | last post by:
I am have made a simple script that moves all desktop clutter (ie files that are not *.lnk) to a specified folder eg. c:\myhome\mydocs\desktopdebris\2003-12-16 ...
2
by: Matthew Morvant | last post by:
I have am working with a text file and wish to move the file when I am done working with it. I have the following defined: InputFolder: "D:\dhc_work\indexed\" OutputFolder:...
1
by: Matthew Eno | last post by:
I have a problem where I'm developing some code that moves files from one place to another (on the same drive) with the destination file having a new name. What's happening is that the line of...
3
by: Don | last post by:
I have a strange bug popping up every once in a while. I've got a section of code that executes these statements when working with a streamwriter: --- Start --- .... ' Close the...
1
by: Tim Failes | last post by:
This seems a trival question, but I cannot get it to work properly... Essentially my question is, how can I create a text file, and guarantee it is given the current date/time as the Creation Time?...
6
by: lilcech | last post by:
How can i cobine my image with a html file so i only have one file. The image is used inside the html file so if i delete it or move it, then it wont show up in the html file. :)
1
by: kkizer | last post by:
I have a problem with this simple code below. Moving the files works perfectly, but once in a blue moon the file that it is trying to move dissapears before it can move it. and when this happens...
3
by: Arpan | last post by:
A Form has a FileUpload, 2 Buttons & a TextBox web server controls. Using the FileUpload control, I want to give users the provision to move & delete files that DO NOT exist in C:\Inetpub\wwwroot...
1
by: Osoccer | last post by:
...to a different folder and in the relocated file concatenates all of the lines in one long string with a space between each line element. Here is a fuller statement of the problem: I need a...
4
by: Roopesh | last post by:
Hi, I have a multithreaded application. There are two threads, T1 and T2. Suppose that there are two folders A, B. Thread T1 fetches data from network and creates files in folder A and after...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.