Need to Impersonate user forAccessing Network resource, Asp.Net Account

前端 未结 5 1880
别那么骄傲
别那么骄傲 2020-12-10 20:55

I need to access a network resource on which only a given Domain Account has access. I am using the LogonUser call, but get a \"User does not have required priviliege\" exce

5条回答
  •  我在风中等你
    2020-12-10 21:31

    Just calling LogonUser is not enough. You need to impersonate that user. You can impersonate for just the access to the network resource.

    Sample code can be found on MSDN.

提交回复
热议问题