access dir on other machine

A

A.V.C.

How to access directory on other machine in the network.
If I use path of the server machine it works fine
I want to access other machine that needs uname and pwd.

I have tried
1) Gave the right to act as part of OS TO ASPNET USER IN LOCAL
SECURITY POLICIES

2) <identity impersonate="true"
userName="user12"
password="pwddd12" />
setting in the web.config

This does not work and says :

Could not create Windows user token from the credentials specified in
the config file. Error from the operating system 'A required privilege
is not held by the client. '


my code:
DownDirPath = "\\domain\folder_name\xyz"
'DownDirPath = "C:\UPLOAD\voice"

DownDirLength = DownDirPath.Length()
DownMyDir = New DirectoryInfo(DownDirPath)

'DownMyFileInfos = DownMyDir.GetFiles("*.*")
DownTotalElements = DownMyFileInfos.Length()

DownAllFilesName = Directory.GetFiles(DownDirPath, "*.*")
 
R

Raterus

you have use use a domain user to access this drive, perhaps all you need to do is this

<identity impersonate="true"
userName="MYDOMAIN\user12"
password="pwddd12" />

also, I'd suggest removing "act as part of OS" on aspnet user immediately, that is a major security risk when you realize what it is doing. Usually this is suggested by ignorant people who don't know better, they just got it "working" because they enabled it. For your problem it won't work since you are accessing network resources, but you've managed to make your aspnet completely unsecure to every file on your webserver, as no NTFS file permissions can keep it controlling the filesystem.

--Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top