⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 auth.cs

📁 用友内部插件
💻 CS
字号:
using System;
using System.Windows.Forms;
using UFSoft.U8.Framework.LoginContext;
using UFSoft.U8.Framework.SecurityCommon;
using UFSoft.U8.Framework.Login.UI;
namespace sample
{
    public partial class Auth : Form
    {
        public Auth()
        {
            InitializeComponent();
        }

        private void moduleAuth_Click(object sender, EventArgs e)
        {
            clsLogin Login = new UFSoft.U8.Framework.Login.UI.clsLogin();

            if (Login.login("DP", "demo", "", "echocloud", "2006-12-01", "(default)@001", ""))
            {
                CalledContext Context = new CalledContext();
                Context.subId = "FA";
                Context.token = Login.userToken;
                ModuleAuth auth = new ModuleAuth(Context);
                if (!auth.TaskExec("FA0515", -1))
                {
                    if (auth.ErrNumber != 0)
                    {
                        MessageBox.Show(auth.ErrDescript);
                    }
                    else
                    {
                        MessageBox.Show("出现无法预知的错误,无法申请功能");
                    }
                }
                else
                {
                    MessageBox.Show("OK_WA011701");
                }
            }
            else
            {
                MessageBox.Show("create u8login failed" + Login.ErrDescript );
            }
            
        }

        private void contentAuth_Click(object sender, EventArgs e)
        {
            ContentAuth obj = new ContentAuth(@"Provider=SQLOLEDB.1;
                            Password=;Persist Security Info=True;User ID=sa;
                            Initial Catalog=UFDATA_001_2007;
                            Data Source=ECHOCLOUD", "zy", true);
            string str = obj.GetAuthString("user", null, "R");
            MessageBox.Show("auth:" + str);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -