|
Home > Archive > Microsoft Content Management Server > August 2004 > File Download
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hello,
a great problem for me is to download a file by other
account than the logon user. I change the identity ->
int usertoken;
bool LoginOK = LogonUser
("user", "", "pwd", 3, 0, out usertoken);
if(LoginOK)
{
Session["usertoken"] =
usertoken;
}
WindowsIdentity
ImpersonationIdentity = new WindowsIdentity((IntPtr)
usertoken);
WindowsImpersonationContext
ImpersonationContext = ImpersonationIdentity.Impersonate();
WindowsIdentity Identity =
WindowsIdentity.GetCurrent();
This account have access to the folder and can only upload
a file ;-(
Can anyone help me??
Thanks a lot and best regards
Andy
| |
| Stefan [MSFT] 2004-08-17, 7:51 am |
| Hi Andy,
this does not look like a MCMS related question.
You should post this to an ASP.NET related newsgroup.
Cheers,
Stefan.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver
MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------
"Andy" <anonymous@discussions.microsoft.com> wrote in message
news:038301c4843d$f00c5cb0$a301280a@phx.gbl...
> Hello,
> a great problem for me is to download a file by other
> account than the logon user. I change the identity ->
>
> int usertoken;
> bool LoginOK = LogonUser
> ("user", "", "pwd", 3, 0, out usertoken);
> if(LoginOK)
> {
> Session["usertoken"] =
> usertoken;
> }
>
> WindowsIdentity
> ImpersonationIdentity = new WindowsIdentity((IntPtr)
> usertoken);
> WindowsImpersonationContext
> ImpersonationContext = ImpersonationIdentity.Impersonate();
>
> WindowsIdentity Identity =
> WindowsIdentity.GetCurrent();
>
> This account have access to the folder and can only upload
> a file ;-(
> Can anyone help me??
> Thanks a lot and best regards
> Andy
|
|
|
|
|