Exemple #1
0
        private static bool Installation()
        {
            //{
            //	"name": "ThunderCross",
            //	"description": "Thunder invoker binary",
            //	"path": "U:/Projects/FireFox/NewThunderCross/ThunderCross/ThunderCross/bin/x64/Debug/ThunderCross.exe",
            //	"type": "stdio",
            //	"allowed_extensions": [ "Thunder@Cross" ]
            //}
            JObject jObject = new JObject
            {
                { "name", "ThunderCross" },
                { "description", "Thunder invoker binary" },
                { "path", Application.ExecutablePath },
                { "type", "stdio" },
                { "allowed_extensions", JToken.FromObject(new string[] { "Thunder@Cross" }) }
            };
            StreamWriter config_json = new StreamWriter(Strings.Config_json, append: false);

            config_json.Write(jObject.ToString());
            config_json.Flush();
            config_json.Close();
            string configPath = Environment.CurrentDirectory + @"\" + Strings.Config_json;

            try
            {
                RegistryKey key = Registry.CurrentUser.OpenSubKey("Software");
                if (key != null)
                {
                    key = key.OpenSubKey("Mozilla");
                    if (key == null)
                    {
                        key = Registry.CurrentUser.OpenSubKey("Software", writable: true);
                        key.CreateSubKey("Mozilla");
                        key.Close();
                        key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Mozilla");
                    }
                    key = key.OpenSubKey("NativeMessagingHosts");
                    if (key == null)
                    {
                        key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Mozilla", writable: true);
                        key.CreateSubKey("NativeMessagingHosts");
                        key.Close();
                    }
                    key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Mozilla").OpenSubKey("NativeMessagingHosts", writable: true);
                    RegistryKey tckey = key.CreateSubKey("ThunderCross");
                    tckey.SetValue(null, configPath);
                    key.Close();
                    tckey.Close();
                    return(true);
                }
            }
            catch (System.Security.SecurityException e)
            {
                ErrorDialog.Report(e.Message + "\n" + e.StackTrace);
            }
            return(false);
        }
Exemple #2
0
        public void Fire()
        {
            AgentClass agent;

            try
            {
                agent = new AgentClass();
            }
            catch (Exception e)
            {
                ErrorDialog.Report(Strings.Call_Thunder_Error_Agent + "\n" + e.Message + "\n" + e.StackTrace);
                return;
            }
            try
            {
                Type type   = typeof(AgentClass);
                var  method = type.GetMethod("AddTask12");                      //only on x86
                method.Invoke(agent, new object[] { Url, FileName, "", PostData.ToString(), Refer, "", -1, 0, -1, Cookie, "", "", 0u, "rightup" });
            }
            catch (Exception)
            {
                try
                {
                    agent.AddTask5(bstrUrl: Url,
                                   bstrFileName: FileName,
                                   bstrCookie: Cookie,
                                   bstrReferUrl: Refer,
                                   bstrComments: PostData.ToString(),
                                   eCallType: _tag_Enum_CallType.ECT_Agent5);
                }
                catch (Exception)
                {
                    try
                    {
                        agent.AddTask(bstrUrl: Url,
                                      bstrFileName: FileName,
                                      bstrReferUrl: Refer,
                                      bstrComments: PostData.ToString());
                    }
                    catch (Exception e)
                    {
                        ErrorDialog.Report(Strings.Call_Thunder_Error_Agent + "\n" + e.Message + "\n" + e.StackTrace);
                        return;
                    }
                }
            }
            try
            {
                agent.CommitTasks4(1, 1);
            }
            catch (Exception e)
            {
                ErrorDialog.Report(Strings.Call_Thunder_Error_Agent + (Environment.Is64BitProcess?Strings.Recommand_32bit:"") + e.Message + "\n" + e.StackTrace);
                return;
            }
        }
Exemple #3
0
        public void Fire()
        {
            CIDMLinkTransmitterClass cIDM;

            try
            {
                cIDM = new CIDMLinkTransmitterClass();
                cIDM.SendLinkToIDM(Url, Refer, Cookie, PostData.ToString(), null, null, null, FileName, 0);
            } catch (Exception e)
            {
                ErrorDialog.Report(Strings.Call_Thunder_Error_Agent + "\n" + e.Message + "\n" + e.StackTrace);
                return;
            }
        }