123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using loadingForm;
- using Newtonsoft.Json.Linq;
- namespace prBrowser
- {
- public class HardwareHandler
- {
- public string DynamicLoadingDLL(string input)
- {
- JObject jObject = new JObject();
- string directory = "";
- string logString = "";
- try
- {
- JObject jsonObj = JObject.Parse(input);
- if (jsonObj["inputDir"] != null)
- {
- directory = jsonObj["inputDir"]!.ToString().Replace("/", ".").Replace("\\", ".");
- }
- logString = "调用开始0:------------------------------------------------------------------------------------------";
- Log.LogInfo(logString, directory);
- }
- catch (Exception ex2)
- {
- jObject.Add("errorCode", (JToken)"-1");
- jObject.Add("errorMessage", (JToken)ex2.Message);
- logString = "调用开始0:" + jObject.ToString();
- Log.LogInfo(logString, directory);
- }
- logString = "调用开始1:" + input;
- Log.LogInfo(logString, directory);
- string output = "";
- try
- {
- XYSLocalLoader xysll = new XYSLocalLoader();
- output = xysll.LoadAssembly(input);
- xysll.Unload();
- }
- catch (Exception ex)
- {
- output = ex.Message;
- logString = "调用异常2:" + output;
- Log.LogInfo(logString, directory);
- }
- Log.LogInfo("调用结束 :" + output, directory);
- Log.LogInfo("调用结束 :------------------------------------------------------------------------------------------", directory);
- return output;
- }
- }
- }
|