Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 24th, 2007, 08:04 PM
Authorized User
 
Join Date: Apr 2004
Location: , , .
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
Reply With Quote
  #2 (permalink)  
Old February 26th, 2007, 08:38 PM
Authorized User
Points: 333, Level: 6
Points: 333, Level: 6 Points: 333, Level: 6 Points: 333, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Fresno, California, USA.
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.

Reply With Quote
  #3 (permalink)  
Old February 27th, 2007, 01:59 PM
Authorized User
 
Join Date: Apr 2004
Location: , , .
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.