File Download?

From: Andy (anonymous_at_discussions.microsoft.com)
Date: 08/17/04

  • Next message: mifko: "UserControl inside IE can't connect to MSSQL"
    Date: Tue, 17 Aug 2004 05:14:40 -0700
    
    

    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


  • Next message: mifko: "UserControl inside IE can't connect to MSSQL"