使用C#中的不同用户凭据将文件保存到文件系统 [英] Saving file to the file system using different user credentials in C#

查看:57
本文介绍了使用C#中的不同用户凭据将文件保存到文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用与我当前登录的用户不同的用户将文件保存到文件系统中?

How can I save a file to the file system using a different user than the one i'm currently logged in with ?

我当前正在使用.NET Framework 4.0。

I'm currently using .NET Framework 4.0.

推荐答案

如果其他用户具有登录凭据,则可以模拟其他用户

You can impersonate the other users if you have their login credentials

使用DllIMport在Win32中调用LogonUser

Use DllIMport to call LogonUser in Win32

这篇关于使用C#中的不同用户凭据将文件保存到文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆