Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

How to access a network drive from a Windows service?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eve - 20 Nov 2006 16:23 GMT
I have a VB .NET app that lets you create a DTS Package that copies data from
an SQL Server to a database located in the specified path (it should work
with both local and network drives). You can either run the package from
within the application or as a Windows service. If I specify a network drive
and run the package from the app, the data is being copied fine, but the
service gives me "Table not accessible" error. My understanding is I have to
configure my Windows service to run with the proper domain user account. In
other words, I need to set my service to log in with an account with the
appropriate permissions to the network path I want to access. What's the
syntax for that? What functions do I have to use? I could not find any sample
code.

Thank you for help.
Eve - 20 Nov 2006 16:44 GMT
My service was able to access the network drive after I unchecked "Local
System account" and specified my network account through Administrative
Tools/Services, but is there a way to let the user specify the account
through the application?
sloan - 20 Nov 2006 17:21 GMT
Try these:

http://www.codeproject.com/csharp/zetaimpersonator.asp

http://www.codeproject.com/csharp/cpimpersonation1.asp

http://msdn2.microsoft.com/en-us/library/ms731090.aspx

you'll at least see the concepts of impersonation.

Note, impersonate in a asp.net application is easy, but not so with a
winforms, console or service application.

> My service was able to access the network drive after I unchecked "Local
> System account" and specified my network account through Administrative
> Tools/Services, but is there a way to let the user specify the account
> through the application?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.