Thanks, what if the server is not a part of any Domain its a
standalone?
TIA
"Nicholas Paldino [.NET/C# MVP]" <
[email protected]>
wrote
in
message Vai2000,
What you want to do is call the LogonUser API function, logging in
with
the user's credentials that you want to impersonate. Then, you will call
the Impersonate method on the WindowsIdentity class, passing the user
token
to be impersonated.
You can then make your call, and it will be under that other
user's
account. Mind you, you need to be careful about these credentials being
embedded in your app.
Check out the documentation for the Impersonate method on the
WindowsIdentity class (the overload that takes an IntPtr parameter)
for a
code example.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Hi All, How do I access a shared Drive which requires username and
password
to access?
I need to write a file in a folder within it
TIA