Example #1
0
        /// <summary>
        /// Doesnt work
        /// </summary>
        /// <returns></returns>
        static string GetPythonPath()
        {
            RegistryKey key         = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Installer\Assemblies");
            string      regfilepath = "";

            if (key != null) // Make sure there are Assemblies
            {
                foreach (string Keyname in key.GetSubKeyNames())
                {
                    if (Keyname.IndexOf("python.exe") > 0)
                    {
                        regfilepath = Keyname.Replace('|', '\\');
                        return(regfilepath);
                    }
                }
            }
            return(null);
        }
Example #2
0
        public override string ToString()
        {
            this.Init__jsonIgnore();
            string json = string.Concat(
                __jsonIgnore.ContainsKey("Id") ? string.Empty : string.Format(", Id : {0}", Id == null ? "null" : Id.ToString()),
                __jsonIgnore.ContainsKey("Create_time") ? string.Empty : string.Format(", Create_time : {0}", Create_time == null ? "null" : Create_time.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()),
                __jsonIgnore.ContainsKey("Keyname") ? string.Empty : string.Format(", Keyname : {0}", Keyname == null ? "null" : string.Format("'{0}'", Keyname.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Name") ? string.Empty : string.Format(", Name : {0}", Name == null ? "null" : string.Format("'{0}'", Name.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))), " }");

            return(string.Concat("{", json.Substring(1)));
        }