File Download
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > File Download




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    File Download  
Andy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:51 PM

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





[ Post a follow-up to this message ]



    Re: File Download  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-17-04 12:51 PM

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...>
MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...nagement+Server
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







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:13 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register