根据系统帐户名称执行表格 [英] Execute Form based on System Account Name

查看:64
本文介绍了根据系统帐户名称执行表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我已经创建了两个主窗体AS FrmAdmin frmuser ,并希望执行 FrmAdmin 将在系统用户名为<在除管理员
之外的任何帐户中,都将打开b>管理员或 frmUser 名称 但是我无法创建它,因为我没有任何逻辑指定如何在条件上执行 Main 方法.
请帮帮我..:((:((<

Hey, i have create two main Form AS FrmAdmin and frmuser and Want to Execute that FrmAdmin will open when System user Name is Administrator or frmUser name is open in any account except Administrator
but i am unable to create it because i have no any logic how to specify a Main Method to execute on a Condition.
Please Help Me.. :(( :((

推荐答案

当我得到您的答案时,您有两个主表单,并且您希望基于以下内容执行主表单系统用户名.
您可以尝试一下,它可能会起作用

As i getting your Answer you have two Main Form and you want to execute your Main Form on the basis of System user Name.
You Can try this, it may Work

if (SystemInformation.UserName.Equals("Administrator"))
            {
                Application.Run(new FrmAdmin());
            }
            else
             { 
          Application.Run(new frmUser());
             }


这篇关于根据系统帐户名称执行表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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