91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-06-16
  • 語言: C#
  • 標簽: KIS專業(yè)版??

資源簡介

C#調(diào)用金蝶登錄窗口(專業(yè)版12.2以后也可以),非專業(yè)代碼,也非專業(yè)程序員!

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Reflection;

namespace?cndrgj
{
????class?KingdeeLogin
????{
????????public?Boolean?KISLogin()
????????{

????????????try
????????????{
????????????????//ps:K3或者KIS調(diào)用登錄窗口,其中有K3Login.dll的直接調(diào)用,KISLogin的:KIS專業(yè)版12.2以前的直接調(diào)用,12.2以后的直接調(diào)用不行
????????????????//然后我就在網(wǎng)上找到了vb調(diào)用12.2以后的方法,需要執(zhí)行一個SetDate方法,
????????????????//我不知道C#怎么寫這個方法,就直接把VB的這個SetDate方法生成dll,然后在C#里調(diào)用這個DLL就可以了
????????????????//下面是VB方法:
????????????????//Private?Declare?Function?GetDesktopWindow?Lib?“user32“?()?As?Long
????????????????//Private?Declare?Function?SetProp?Lib?“user32“?Alias?“SetPropA“?(ByVal?hwnd?As?Long?ByVal?lpString?As?String?ByVal?hData?As?Long)?As?Long
????????????????//Private?Declare?Function?GetCurrentProcessId?Lib?“kernel32“?()?As?Long
????????????????//Private?m_dctGlobalInfo?As?object
????????????????//Private?m_oSpmMgr?As?object

????????????????//‘SetData方法僅用于KIS專業(yè)版12.2及之后版本登陸窗體調(diào)用,前面版本不需要增加
????????????????//‘Public?Sub?SetData()
????????????????//‘????Set?m_dctGlobalInfo?=?Createobject(“KFO.Dictionary“)
????????????????//‘????SetProp?GetDesktopWindow?GetCurrentProcessId?ObjPtr(m_dctGlobalInfo)
????????????????//‘End?Sub

????????????????//Public?Sub?SetData()
????????????????//????Set?m_dctGlobalInfo?=?Createobject(“KFO.Dictionary“)
????????????????//????SetProp?GetDesktopWindow?GetCurrentProcessId?ObjPtr(m_dctGlobalInfo)
????
????????????????//End?Sub

????????????????//‘SetData方法僅用于KIS專業(yè)版12.2及之后版本登陸窗體調(diào)用,前面版本不需要增加
????????????????Type?SetDatet?=?System.Type.GetTypeFromProgID(“KISSetDate.KISSetDateC“);
????????????????object?SetDateloginer?=?Activator.CreateInstance(SetDatet);
????????????????object?SetDateo?=?SetDatet.InvokeMember(“SetData“?BindingFlags.Default
????????????????????|?BindingFlags.InvokeMethod?null?SetDateloginer?null);

????????????????//創(chuàng)建
????????????????Type?t?=?System.Type.GetTypeFromProgID(“KISLogin.ClsLogin“);

????????????????if?(t?==?null)
????????????????{
????????????????????MessageBox.Show(“加載金蝶登錄器失敗需要安裝金蝶客戶端.“?“提示“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????????return?false;
????????????????}
????????????????object?loginer?=?Activator.CreateInstance(t);
????????????????if?(loginer?==?null)
????????????????{
????????????????????MessageBox.Show(“加載金蝶登錄器失敗loginer為空“?“提示“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????????return?false;
????????????????}
????????????????//Login的方法參數(shù)
????????????????object[]?args?=?new?object[]?{?“super“?“主控臺“?true?};
????????????????//訪問KISLogin.dll的Login方法,調(diào)用登陸窗口
????????????????object?o?=?t.InvokeMember(“Login“?BindingFlags.Default
????????????????????|?BindingFlags.InvokeMethod?null?loginer?args);
????????????????//獲取指定屬性的數(shù)據(jù)
????????????????if?(Convert.ToBoolean(o)?==?true)
????????????????{
????????????????????//ConnectString={Persist?Security?Info=True;Provider=

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????9803??2018-06-03?22:26??KingdeeLogin.cs
?????文件???????24576??2018-06-03?21:40??KISSetDate.dll

評論

共有 條評論