By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,670 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,670 IT Pros & Developers. It's quick & easy.

question on LogonUser

P: n/a
bob
Hi

My Project has 2 servers, a Web Server(Windows 2000) and a DB
Sever(Windows 2003).
DB Server has an account called "testAccount"

on Web Server, there is a shared folder named "Test", the
"testAccount" has the full control of the "Test" folder.
i wrote a .exe file to logon to DB Sever to fetch a file with the
account "testAccount".code like this:
************************************************** *****
IntPtr tokenHandle = IntPtr.Zero;
WindowsImpersonationContext wic = null;
const int LOGON32_LOGON_NEW_CREDENTIALS = 9;
const int LOGON32_PROVIDER_WINNT50 = 3;

bool returnValue = LogonUser(
"testAccount",
"DB SeverName",
"pwd",
LOGON32_LOGON_NEW_CREDENTIALS,
LOGON32_PROVIDER_WINNT50,
ref tokenHandle);
************************************************** *****
when double click the .exe file In Web Server,
the LogonUser() returns true, but cannot read file in "Test" folder.
the WindowsIdentity.GetCurrent().Name also returns Web Server's User
Name,not "testAccount"

anyone call help me?
thanks
Jul 2 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
bob
sorry,
>>on Web Server, there is a shared folder named "Test"
should be
on DB Server, there is a shared folder named "Test"
Jul 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.