SAP.Connector.SAPConnection myConn;
SAP.Connector.SAPLogonDestination myDest;
myDest = new SAP.Connector.SAPLogonDestination();
myDest.Client = 100;
myDest.AppServerHost = "192.168.1.1";
myDest.SystemNumber = "80";
myDest.Username = "yubofighting";
myDest.Password = "*****";
myDest.Language = "ZH";
myConn = new SAP.Connector.SAPConnection(myDest);
myConn.Open();
当我们用上面的代码连接SAP的时候,会提示myDest.AppServerHost和myDest.SystemNumber是只读(read only)的,主要原因是
SAP.Connector.SAPLogonDestination取的是本地SAPLogin.ini配置文件中的值,SAPLogin.ini中已经配置了服务器地址和实例编号,所以不需要再写入程序
如果需要自定义,只要将SAP.Connector.SAPLogonDestination修改成SAP.Connector.Destination就可以了:
SAP.Connector.SAPConnection myConn;
SAP.Connec