基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
using Lskj.Business;
|
||||
using Lskj.Model;
|
||||
using Lskj.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
|
||||
namespace Lskj.PubCadViewer
|
||||
{
|
||||
/// <summary>
|
||||
/// c#库被调用统一接口类
|
||||
/// </summary>
|
||||
public sealed class DllBaseClass : IForm
|
||||
{
|
||||
public DllBaseClass()
|
||||
{
|
||||
|
||||
}
|
||||
private static readonly string CmdStartPath = Environment.CurrentDirectory + "\\CadViewer";
|
||||
public DllBaseClass(string[] obj)
|
||||
{
|
||||
try
|
||||
{
|
||||
Process process = new Process();
|
||||
try
|
||||
{
|
||||
process.StartInfo.FileName = "cmd.exe ";
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.RedirectStandardInput = true;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
process.StartInfo.RedirectStandardError = true;
|
||||
process.StartInfo.CreateNoWindow = true;
|
||||
process.StartInfo.WorkingDirectory = CmdStartPath;
|
||||
process.Start();
|
||||
process.StandardInput.WriteLine("regsvr32 /s CADViewerX.ocx");
|
||||
process.StandardInput.Close();
|
||||
string result = process.StandardOutput.ReadToEnd();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
process.Close();
|
||||
}
|
||||
DynamicCadViewerModel moduleModel = new DynamicCadViewerModel(obj);
|
||||
FrmMain main = new FrmMain();
|
||||
this.SubForm = main;
|
||||
this.SubForm.Text = moduleModel.FormText;
|
||||
main.CadViewerModel = moduleModel;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogUtil.WriteError("Lskj.PubCadViewer.dll--参数错误-->" + obj.ToString(), ex);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗口
|
||||
/// </summary>
|
||||
public Form SubForm { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user