C# Function to Load Database Owner from XML
public string LoadDatabaseOwner_auto() { string DatabaseOwner = ""; try { strIdentity = CombineXMLIdentity(gComputerName, gUserNo, DateTime.Now); InXml = CombineXMLRequest(strIdentity, ""); wsSYS.wsSYS oSYS = new wsSYS.wsSYS(); oSYS.Url = LocalizeWebService(oSYS.Url.ToString()); OutXml = oSYS.LoadAllDataSourceAndOwner(InXml); oSYS.Dispose(); XmlDocument XmlDoc = new XmlDocument(); XmlDoc.LoadXml(OutXml); string sTemp; if (ChkExecutionSuccess(XmlDoc)) { sTemp = XmlDoc.GetElementsByTagName('returnvalue').Item(0).InnerXml; } else { throw new Exception(GetExceptionSysMsg(XmlDoc)); //ExceptionManager.iMESShowDialog(GetExceptionCode(XmlDoc), GetExceptionSysMsg(XmlDoc), GetExceptionStack(XmlDoc)); return null; } XmlDoc = null; string[] aTemp = sTemp.Split(';'); Array.Sort(aTemp); foreach (string temp in aTemp) { if (temp.ToLower().StartsWith('databaseowner=')) { DatabaseOwner = temp.Substring(14, temp.Length - 14); } } } catch (Exception e1) { DatabaseOwner = ""; } return DatabaseOwner.ToUpper(); }
原文地址: https://www.cveoy.top/t/topic/j6ad 著作权归作者所有。请勿转载和采集!