473,513 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File.Move() using different credentials?

I am looking for a way to copy a file from a local drive on the server to a
network share but I need to authenticate as a user that has access to the
network share. How can I tie a different set of credentials to the
File.Move()? I can add an Impersonate tag with domain,Username, and
Password to the web.config to get the code to work on my machine as myself
but I think I will have problems when I deploy to a server that does not
have my account as an administrator on it. I would like to simply build a
NetworkCredential object and tie it to the File.Move() call but that does
not appear to be an option.

Does anyone have a example of this? It seems like a fairly simple task but
I am not finding much.

Any ideas would be most appriciated.
Thanks,
Andy
Nov 30 '06 #1
0 1133

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

Similar topics

2
3563
by: Stu | last post by:
Using IIs 6.0 on a Server 2003 box, and using ASP.NET I'm trying to do the following code snippit... Dim NewName As String = "\\network_share_path\edit_me.ppt" Dim PubName As String = "\\network_share_path\show_me.ppt" Dim PubFile As System.IO.File If PubFile.Exists(PubName) Then
3
2543
by: Jørn A. | last post by:
I'm working on a web based user interface for a job scheduling system (running scripts). The system is using a non-windows scheduler software, but it's installed and running as a windows service. The service is running with the credentials of a specified domain user, and all processes kicked off by the scheduler service runs with these...
6
3985
by: Pat Carden | last post by:
Hi, We need to allow webusers to upload a file on our website (on Server3, all servers run Server 2003, remotely hosted) and eventually save it on our SBS Server (Server2) which is not exposed through our firewall. We have another server (Server1) within the SBS domain that is exposed through port 80 of the firewall on which we host some...
11
3047
by: Andre | last post by:
Hi, I have ASP.NET application running on standalone (not part of the domain) Windows 2003. I use forms authentication for my application. The problem I have is that I need to create and read files on Windows domain network shared drives and also on shared via Samba Unix drives, which is equivalent to writing/reading to the workgroup...
2
12300
by: Glen Conway | last post by:
Hi, I am trying to get the contents of a file in a hidden share on a remote server, something like '\\server.domain.com\c$\program files\application\document.xml'. When I try any of the standard streamreader, textreader or file classes I get an access denied error message (which I expect). If I go Start | Run and type this in, I get...
9
11997
by: Mantorok | last post by:
Hi all C# v2.0 I want to update a server which is in our DMZ, to access this server I always need to enter the admin user id and password. I want to copy some files overnight to this server using a C# app, is this possible? Can I provide the credentials to enable me to access the server?
3
500
by: coffeebasket | last post by:
I have created an Windows Service application, and it is suppose to move downloaded files from localdir to a network dir but it fails. The same code in a consol application works just fine. I have tried username + password in the Windows Service application but still no luck. Could someone shead some light ? tcncc
4
626
by: rgw1 | last post by:
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...
8
6321
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource. Just to get it to work, I hard-coded the username and password of a SQL Server account in the connectionstring in web.config. Once I confirmed...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.