Beispiel #1
0
 /// <summary>
 /// scrrun.dll이 등록되지 않은 컴퓨터가 있는 경우, 강제로 등록함.
 /// </summary>
 /// <param name="ErrMsgIs"></param>
 /// <returns></returns>
 public static void RegisterScriptingRuntime()
 {
     try
     {
         Type t = Type.GetTypeFromProgID("Scripting.FileSystemObject");
     }
     catch (Exception)
     {
         string System32Folder = Environment.GetFolderPath(Environment.SpecialFolder.System);
         string FullPath       = Path.Combine(System32Folder, "scrrun.dll");
         CRegComponent.Register(FullPath);
     }
 }
Beispiel #2
0
        private static dynamic GetDsoDocProp()
        {
            dynamic DsoProp = CreateDsoDocProp();

            if (DsoProp == null)
            {
                //32비트용이므로 C:\windows\SysWOW64에 있음.
                string DsoFileFullPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86), "dsofile.dll");
                if (!File.Exists(DsoFileFullPath))
                {
                    return(null);
                }

                try
                {
                    CRegComponent.Register(DsoFileFullPath);
                }
                catch (Exception) { }

                DsoProp = CreateDsoDocProp();
            }

            return(DsoProp);
        }