我有一些想要注册的 VB6 .ocx 文件。这些 .ocx 文件将位于远程计算机上。
以编程方式注册这些 .ocx 文件的最佳方法是什么?
string arg_fileinfo = "/s" + " " + "\"" + "\\<remotemachine>\\<directory>\\<ocx>" + "\"";
Process reg = new Process();
//This file registers .dll files as command components in the registry.
reg.StartInfo.FileName = "regsvr32.exe";
reg.StartInfo.Arguments = arg_fileinfo;
reg.StartInfo.UseShellExecute = false;
reg.StartInfo.CreateNoWindow = true;
reg.StartInfo.RedirectStandardOutput = true;
reg.Start();
reg.WaitForExit();
reg.Close();
我没有收到任何错误,但它也没有注册 .ocx。有任何想法吗?