找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
楼主: 什么是东西

[经验] 810.1登录界面调用(扯淡)

    [复制链接]
发表于 2012-11-20 11:21:32 | 显示全部楼层
用友的web产品必须开80端口,比较烦!
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-20 13:27:31 | 显示全部楼层
做二次开发的调用吧 给开发的东西 加载登录。

U890的 U810.1不能用了
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-20 16:47:02 | 显示全部楼层
看看 支持下哦
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-21 08:52:20 | 显示全部楼层
没看明白楼主要说什么,楼上的同志们好像也没看懂!
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-22 09:38:29 | 显示全部楼层
没看明白你这个有什么用。
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-22 21:35:45 | 显示全部楼层
自己写的代码?

点评

必须自己写的,要不发上来干什么??  详情 回复 发表于 2012-11-22 22:15
回复 点赞 拍砖

使用道具 举报

 楼主| 发表于 2012-11-22 22:15:14 | 显示全部楼层
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-23 00:00:33 | 显示全部楼层
神马意思?
回复 点赞 拍砖

使用道具 举报

发表于 2012-11-28 13:36:23 | 显示全部楼层
很简单的调控你想的真够难得的。
回复 点赞 拍砖

使用道具 举报

发表于 2012-12-4 08:34:09 | 显示全部楼层
楼主 你知道 单据调用存货的 程序在哪里吗?
我想改调用形式。
回复 点赞 拍砖

使用道具 举报

发表于 2012-12-4 14:51:56 | 显示全部楼层
10.1还是挺多人升级的
回复 点赞 拍砖

使用道具 举报

发表于 2012-12-4 23:21:45 | 显示全部楼层
这是U8的调用登录代码!
  1. [STAThread]
  2. private static void Main(string[] args)
  3. {
  4.     try
  5.     {
  6.         bool flag = false;
  7.         if (!WindowsDispatch.HandleRunningInstance(UFIDA.U8.WorkFlow.ProcessResourceManager.ProcessResourceManager.GetString("U8.WF.Designer.Process.frmmain.00115")))
  8.         {
  9.             if ((args != null) && (args.Length > 0))
  10.             {
  11.                 StringBuilder builder = new StringBuilder();
  12.                 foreach (string str in args)
  13.                 {
  14.                     builder.Append(str);
  15.                     builder.Append(" ");
  16.                 }
  17.                 try
  18.                 {
  19.                     SingleLoginInfo info = new SingleLoginInfo().DeSerializable(builder.ToString());
  20.                     clsLogin login = new clsLogin();
  21.                     [color=Red]flag = login.login(info.PSubId, info.UserId, info.Pwd, info.AppServer, info.OperDate, info.DataSource, info.WorkStationSerial);[/color]                    if (flag)
  22.                     {
  23.                         LoginInfo.setLoginInfo(login);
  24.                         Thread.CurrentThread.CurrentCulture = new CultureInfo(info.LanguageID);
  25.                         Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
  26.                     }
  27.                 }
  28.                 catch
  29.                 {
  30.                     flag = false;
  31.                 }
  32.             }
  33.             Application.EnableVisualStyles();
  34.             RunApplication(!flag);
  35.         }
  36.     }
  37.     catch (Exception exception)
  38.     {
  39.         MessageBox.Show(exception.Message);
  40.     }
  41. }




复制代码
回复 点赞 拍砖

使用道具 举报

发表于 2012-12-4 23:22:58 | 显示全部楼层
登录clsLogin类
[ClassInterface(ClassInterfaceType.None), Guid("f11ba142-3738-4632-9364-e873ba72daa9")]
public class clsLogin : MarshalByRefObject, _clsLogin, IDisposable
{
    // Fields
    private static AssemblyLoader assembly;
    private string m_AppServer;
    private string m_AppServerSerial;
    private _AuditorContext m_Auditor;
    private string m_Culture;
    private UserData m_curLoginInfo;
    private string m_dataSource;
    private string m_dCurDate;
    private string m_ErrDescript;
    private ResServiceHead m_ErrorRes;
    private bool m_IsCompanyVer;
    private UserData m_reLoginInfo;
    private string m_ResArg;
    private string m_ResourceId;
    private string m_SubId;
    private Hashtable m_SubInfosCollection;
    private string m_TokenID;
    private bool m_UnRegSerialNum;
    private string m_UserId;
    private string m_UserPWD;
    private string m_userToken;
    private string m_WorkStationName;
    private string m_WorkStationSerial;
    private ConnectingLoginBO PeriodConnecting;
    private ConnectingRightServer rightConnecting;
    private SymmetricCryptography symm;
    private const int TDES_KEY_SIZE_BITS = 0xc0;

    // Methods
    static clsLogin();
    public clsLogin();
    private bool Authenticate(string pSubId, bool ShowLoginForm, string DecodeUserId, bool ChangePwd, string NewPassword);
    private void BeforeCallLoginBO();
    public void ClearAppServerCache(string key);
    private void CloseContext();
    private UserData DecryptUserData(string uuid, string encryptUserData);
    private UserData DecryptUserData(string uuid, string encryptUserData, string auditData);
    public void Dispose();
    protected void Dispose(bool disposing);
    public string EnPassWord(string PwdValue);
    protected override void Finalize();
    public string getAppConnstring(string UserToken, string SubID);
    private string GetAppServerName();
    public bool GetAppServerState(string uuid);
    private UserData GetConfigFromFile();
    public string GetDataSource(string AppServerName);
    public string GetDataSource(string AppServerName, string UserId);
    public IDBServerInfo GetDBServerInfo(string connString);
    public string GetDefaultConnstring(string AppServerName);
    public string GetEndSubAuthsWithAuthID(string UserToken, string AuthId, bool IsAdmin, string SubID);
    public string GetFileServerInfo(string UserToken, bool isWeb);
    public ResServiceHead GetLastErrorResID();
    public UserData GetLoginInfo();
    public UserData GetLoginInfo(string UserToken);
    public ProcessVariateHead GetProcessVariate();
    public int GetPwdSecurityLevel(string PwdValue);
    private string GetSerial();
    public SubSystemDataHead GetSubLoginInfo(string SubId);
    public string GetTaskID(string SubID);
    private string InserEletToXML(string xml, string EleName, string AttrName, string AttrValue);
    private UserData InternalGetConfigFromMem(string UserToken);
    private string InternalGetDataSource(string AppServerName, string UserId, string Pwd, string LanguageId);
    private bool InternalLogin(string pSubId, string UserId, string Pwd, string appServer, string operDate, string dataSource, string WorkStationSerial);
    private void InternalShutDown(bool relogin);
    internal void InternalValidateSignedData(UserData userInfo, string pin);
    public bool IsDemoToSubSystem(string UserToken, string SubID);
    public void KickOutWorkStation(string TaskId, string SubId, string uuid, string WorkStationSerial);
    public bool login();
    public bool login(string pSubId);
    public bool login(string pSubId, string UserId, string Pwd);
    public bool login(string pSubId, string UserId, string Pwd, string appServer, string operDate, string dataSource, string WorkStationSerial);
    private void OnAfterAppServerDone();
    private void OnEncryptString(object sender, CryptographEventArgs args);
    private void OpenContext();
    private void SaveConfig2File(UserData data);
    private bool SendSymmetricKey();
    public void SetProcessVariate(ProcessVariateHead ProcessVariate);
    private void SetTimerState(bool isStop);
    public void ShutDown();
    public ProductContext SubLogin(string SubId);
    public void SubLogout(string SubId);
    public void ValidateSignedData(UserData userInfo, SignedDataContext signedData);
    private XmlTextWriter XmlWriteSettings(MemoryStream memStream, UserData data);

    // Properties
    public _AuditorContext Auditor { set; }
    public string dataSource { get; }
    public string ErrDescript { get; }
    public bool IsCompanyVer { get; }
    public string LanguageID { set; }
    public string userToken { get; set; }
    public string WorkStationName { set; }


点评

这么多代码哪里找来的?  发表于 2013-8-13 22:47
回复 点赞 拍砖

使用道具 举报

发表于 2012-12-4 23:24:31 | 显示全部楼层
登录的关键代码
  1. private bool InternalLogin(string pSubId, string UserId, string Pwd, string appServer, string operDate, string dataSource, string WorkStationSerial)
  2. {
  3.     LogService.WriteInfo("begin login");
  4.     bool flag = false;
  5.     string decodeUserId = string.Empty;
  6.     this.m_SubId = pSubId.ToUpper();
  7.     Cryptography.LoginInfo = new UserData();
  8.     LogService.WriteInfo("begin GetSerial");
  9.     if ((WorkStationSerial == null) || (WorkStationSerial.Length == 0))
  10.     {
  11.         WorkStationSerial = this.GetSerial();
  12.     }
  13.     LogService.WriteInfo("end GetSerial");
  14.     this.m_WorkStationSerial = WorkStationSerial;
  15.     if ((this.m_WorkStationName == null) || (this.m_WorkStationName.Length == 0))
  16.     {
  17.         this.m_WorkStationName = Environment.MachineName;
  18.     }
  19.     this.m_UserId = (UserId == null) ? "" : UserId;
  20.     this.m_UserPWD = (Pwd == null) ? "" : Pwd;
  21.     this.m_dataSource = (dataSource == null) ? "" : dataSource;
  22.     if ((pSubId.Length == 0) || (pSubId.Length != 2))
  23.     {
  24.         this.m_ErrDescript = CommonFunction.CallU8ResService().GetResString("U8.AA.LoginBO.InvalidateSubID");
  25.         this.m_ResourceId = "U8.AA.LoginBO.InvalidateSubID";
  26.         this.m_ResArg = string.Empty;
  27.         return false;
  28.     }
  29.     UserData configFromFile = new UserData();
  30.     LogService.WriteInfo("begin  appServer");
  31.     if ((appServer == null) || (appServer.Length == 0))
  32.     {
  33.         configFromFile = this.GetConfigFromFile();
  34.         if ((configFromFile.AppServer == null) || (configFromFile.AppServer.Length == 0))
  35.         {
  36.             this.m_AppServer = Environment.MachineName;
  37.         }
  38.         else
  39.         {
  40.             this.m_AppServer = configFromFile.AppServer;
  41.         }
  42.     }
  43.     else
  44.     {
  45.         this.m_AppServer = appServer;
  46.     }
  47.     LogService.WriteInfo("end  appServer");
  48.     Cryptography.LoginInfo.AppServer = this.m_AppServer;
  49.     CommonFunction.ClearCreditIdentity();
  50.     LogService.WriteInfo("end  ClearCreditIdentity");
  51.     if ((this.m_UserId.Length == 0) || (this.m_dataSource.Length == 0))
  52.     {
  53.         if (this.m_UserId.Length != 0)
  54.         {
  55.             configFromFile.UserId = this.m_UserId;
  56.         }
  57.         if (this.m_dataSource.Length != 0)
  58.         {
  59.             configFromFile.DataSource = this.m_dataSource;
  60.         }
  61.         if ((this.m_Culture == null) || (this.m_Culture.Length == 0))
  62.         {
  63.             if ((configFromFile.LanguageID == null) || (configFromFile.LanguageID.Length == 0))
  64.             {
  65.                 LogService.WriteInfo("begin  GetCultureInfo");
  66.                 configFromFile.LanguageID = CommonFunction.GetCultureInfo();
  67.                 LogService.WriteInfo("end  GetCultureInfo");
  68.             }
  69.         }
  70.         else
  71.         {
  72.             configFromFile.LanguageID = this.m_Culture;
  73.         }
  74.         configFromFile.AppServer = this.m_AppServer;
  75.         configFromFile.cSubID = this.m_SubId;
  76.         LogService.WriteInfo("begin  new FrmLogin");
  77.         FrmLogin login = new FrmLogin(configFromFile);
  78.         LogService.WriteInfo("end  new FrmLogin ");
  79.         login.AfterAppServerDone += new FrmLogin.AfterAppServerHandler(this.OnAfterAppServerDone);
  80.         login.EncryptStringDone += new FrmLogin.EncryptStringHandler(this.OnEncryptString);
  81.         while (!flag)
  82.         {
  83.             LogService.WriteInfo("begin  ShowDialog");
  84.             if (login.ShowDialog() == DialogResult.OK)
  85.             {
  86.                 this.m_UserId = login.txtUser.Text.Trim();
  87.                 this.m_UserPWD = login.txtPWD.Text;
  88.                 this.m_AppServer = login.domainName;
  89.                 this.m_dataSource = login.dataSource;
  90.                 this.m_dCurDate = login.curDate;
  91.                 this.m_Culture = login.CultureID;
  92.                 flag = this.Authenticate(pSubId, true, decodeUserId, login.ChangePwd, login.NewPassword);
  93.                 if (!flag)
  94.                 {
  95.                     if (this.m_ErrDescript.Length != 0)
  96.                     {
  97.                         CustomMsgBox.ShowMsg(this.m_ErrDescript);
  98.                     }
  99.                 }
  100.                 else if (this.m_UnRegSerialNum)
  101.                 {
  102.                     FrmRegSerialNum num = new FrmRegSerialNum();
  103.                     num.ShowDialog();
  104.                     num.Dispose();
  105.                 }
  106.             }
  107.             else
  108.             {
  109.                 this.m_ErrDescript = CommonFunction.CallU8ResService().GetResString("U8.AA.LoginBO.CancelLogin");
  110.                 this.m_ResourceId = "U8.AA.LoginBO.CancelLogin";
  111.                 this.m_ResArg = string.Empty;
  112.                 Cryptography.LoginInfo.AppServer = configFromFile.AppServer;
  113.                 CommonFunction.ClearCreditIdentity();
  114.                 return flag;
  115.             }
  116.         }
  117.         login.Dispose();
  118.         login = null;
  119.         Cryptography.m_DataSource = this.m_dataSource;
  120.         return flag;
  121.     }
  122.     if (this.m_dataSource.IndexOf("@") < 0)
  123.     {
  124.         if ((Cryptography.m_DataSource == null) || (Cryptography.m_DataSource.Length == 0))
  125.         {
  126.             this.m_dataSource = "#@" + this.m_dataSource;
  127.         }
  128.         else
  129.         {
  130.             string[] strArray = Cryptography.m_DataSource.Split(new char[] { '@' });
  131.             this.m_dataSource = strArray[0] + "@" + this.m_dataSource;
  132.         }
  133.     }
  134.     if (operDate.Length == 0)
  135.     {
  136.         operDate = DateTime.Now.ToString("yyyy-MM-dd");
  137.     }
  138.     if ((this.m_Culture == null) || (this.m_Culture.Length == 0))
  139.     {
  140.         this.m_Culture = U8ResService.GetLocaleID();
  141.         if ((this.m_Culture == null) || (this.m_Culture.Length == 0))
  142.         {
  143.             this.m_Culture = CommonFunction.GetCultureInfo();
  144.         }
  145.     }
  146.     this.m_dCurDate = operDate;
  147.     this.SendSymmetricKey();
  148.     return this.Authenticate(pSubId, false, decodeUserId, false, "");
  149. }




复制代码

点评

大哥,没怎么复杂了...  详情 回复 发表于 2012-12-5 17:24
回复 点赞 拍砖

使用道具 举报

 楼主| 发表于 2012-12-5 17:24:04 | 显示全部楼层
cpmodel 发表于 2012-12-4 23:24
登录的关键代码

大哥,没怎么复杂了...

点评

其实也不复杂啊,C#的代码很还好看的,我是把大部分用友的源代码都看懂了啊!  详情 回复 发表于 2012-12-5 17:55
回复 点赞 拍砖

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-6-19 08:53 , Processed in 0.043005 second(s), 13 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表