Exemple #1
0
 public Form1()
 {
     InitializeComponent();
     MCS = new MMCredentialStore("local");
     string[] args = Environment.GetCommandLineArgs();
     if ((args.Length > 1) && (args[1].Trim() != "") && (File.Exists(args[1])))
     {
         string sFile = args[1];
         string sPwd  = MCS["LockBox"].ParseString(" ", 1);
         ox = new LockBox(sFile, sPwd);
         buildTree();
     }
 }
Exemple #2
0
        public TrayAppContext()
        {
            MCS   = new MMCredentialStore("");
            form1 = new Form1();
            form1.LoadContext(this);

            trayIcon             = new NotifyIcon();
            trayIcon.Icon        = Properties.Resources.AppIcon;
            trayIcon.ContextMenu = new ContextMenu(new MenuItem[] {
                new MenuItem("Show Settings", ShowSettingsMenueClick),
                new MenuItem("Exit", ExitMenueClick)
            });
            trayIcon.Visible = true;
        }
Exemple #3
0
        private async void button1_ClickAsync(object sender, EventArgs e)
        {
            var github = new GitHubClient(new ProductHeaderValue("SyncDrop"));

            #region Credit
            MMCredentialStore mc = new MMCredentialStore("");
            if (mc["github"] != "")
            {
                string sCredits = mc["github"];
                string sUser    = sCredits.ParseString(" ", 0);
                string sPwd     = sCredits.ParseString(" ", 1);
                github.Credentials = new Credentials(sUser, sPwd);
            }
            #endregion

            var sRepUser  = "******";
            var sRepName  = "MMDataStore";
            var sFileName = "EFJGJNATBKTTHHQYGL.txt";
            var branch    = "master";

            //  var rMMDataStore = await github.Repository.Get("mmeents", "MMDataStore");
            //  var sName = rMMDataStore.Name;
            //  var sLogin = rMMDataStore.Owner.Login;

            var RepContent = await github.Repository.Content.GetAllContents(sRepUser, sRepName, "path");

            foreach (RepositoryContent rc in RepContent)
            {
                if (rc.Name == sFileName)
                {
                    setMessage(rc.Name + " found in Encoded");
                    String sTempName = Path.GetTempFileName();
                    rc.DownloadUrl.SaveAs(sTempName);
                    FileVar fv        = new FileVar(sTempName);
                    string  sUserHash = mc.rTool.GetPublicCert().toHashSHA512();
                    string  sUserCert = mc.rTool.GetPublicCert();
                    if (fv["Usr" + sUserHash] != sUserCert)
                    {
                        fv["Usr" + sUserHash] = mc.rTool.GetPublicCert();
                        string sSha            = rc.Sha;
                        string sContents       = File.ReadAllText(sTempName);
                        var    updateChangeSet = await github.Repository.Content.UpdateFile(sRepUser, sRepName, "path/" + sFileName,
                                                                                            new UpdateFileRequest("RegisterUserX", sContents, sSha, branch));
                    }
                    break;
                }
            }
        }
Exemple #4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     listBox1.Items.Clear();
     MCS = new MMCredentialStore("eamm", "\\ProtoAlphaSettings.ini");
     loadListBox();
 }