Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 24th, 2007, 08:04 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't access file via Map Network Drive

Hi,
.NET 2005 - I used System.Diagnostics.Process class to start cmd.exe and map network drive to a server on a different domain as follow:
....
       If System.IO.Directory.Exists(sourceDir) = True Then
            myInput.Write("net use z: /DELETE " & myInput.NewLine)
        End If
        **Is the map directory exist? DELETE it before creating it.
        If System.IO.Directory.Exists("z:") = True Then
            myInput.Write("net use z: /DELETE " & myInput.NewLine)
        End If
        '**Map network drive
        myInput.Write("net use z: \\server password /USER:domain\username /PERSISTENT:YES " & myInput.NewLine)
....
After this mapping, I was able to access file while I am debuging my code locally. However, it was not successful when I public to a website. Website directory security? Any suggestion?

By the way, I noticed a lot of program use WNetAddConnection2. Anyone know how I could retain this?

Thanks

Peter
__________________
Peter
 
Old February 26th, 2007, 08:38 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just taking a shot but I had a similar issue with old ASP script setting up a document library and new .NET. Look into delegation. If it is telling you access is denied, it is because the account that is being used isn't setup for delegation and the machine you are connected to is not setup to take delegation. I think that is the correct order. I basically said forget it and used Sharepoint for my document library hehe.

 
Old February 27th, 2007, 01:59 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Quick209
If anyone interesting in delegation, here the link: http://msdn2.microsoft.com/en-us/library/aa291350(VS.71).aspx
I have been dealing mostly with file in the same domain which is easily be done, but on a different domain, I have not get it to work yet.



Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Map Network drive VB .Net Isra2005 General .NET 2 November 26th, 2007 02:11 PM
Publishing a page on network drive Sicklr Access 1 June 21st, 2007 12:35 AM
Stuck with DBF file access from Network Drive kaushalparik ASP.NET 2.0 Professional 2 April 26th, 2007 04:36 AM
How to backup database to Network Drive Jane SQL Server 2000 3 July 4th, 2005 12:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.