如何使用登录表单使用其他凭据运行应用程序 [英] How Do I Run An Application Using Other Credential With A Login Form

查看:72
本文介绍了如何使用登录表单使用其他凭据运行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试进行登录,就像在应用上运行AS一样,它会使用在开始时设置的用户名密码由用户,以便我可以使用System.ServiceProcess ServiceController()来停止和启动Windows服务器上的服务。



我找到了很多方法来做一个登录表单,但非该行为已经运行,其中应用程序的用户名和密码不是来自窗口中的用户而是记录的用户名和密码。



(ps。十年后回到Oracle DBA,所以请保持温和)



任何显示一些示例的帮助或链接。

Hi,

I am trying to make a login that will do like Run AS on a apps would do so that it will use the username password set at start by the user so that i can use System.ServiceProcess ServiceController() to stop and start services on a windows server.

I have found lots of ways to do make a login form but non that act has run as would, where the user name and password of the applications are not the one from the user loged in windows but the one that is logged has.

(ps. just got back after ten years Oracle DBA so please be gentle)

Any help or links showing some examples.

推荐答案

不确定我是否正确理解您的问题,但在询问用户名和密码后,您可以使用给定的用户帐户启动新流程。您只需使用 ProcessStartInfo [< a href =https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo(v=vs.110).aspx\"target =_ blanktitle =New Window> ^ ]定义用户名和密码。



我在目录大小浏览器 [ ^ ]。看看选项2:在应用程序启动期间提升权限中的代码。



再次,对不起,如果我误解了这种情况。
Not sure if I understand your question correctly, but after asking the user name and password, you can start a new process with the given user account. You just need to use the ProcessStartInfo[^] to define the user name and the password.

I used a similar technique in Directory size browser[^]. Have a look at the code in "Option 2: Elevate privileges during the application startup".

Again, sorry if I misunderstood the situation.


这篇关于如何使用登录表单使用其他凭据运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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