private void LoadButton_Click(object sender, EventArgs e)
        {
            DownloadClipboard upload = new DownloadClipboard();

            if (upload.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    Random rand = new Random();
                    int    r    = rand.Next();
                    UserCredentialsStore store = UserCredentialsStore.GetInstance();
                    CodinggainClipboardService.ClipboardInterfaceClient remoteClipboard = new CodinggainClipboardService.ClipboardInterfaceClient();
                    CodinggainClipboardService.EncryptionData           enData          = remoteClipboard.getAccessRights(store.Username, store.getPassword(r), true, r);
                    CodinggainClipboardService.ReturnInterface          data            = remoteClipboard.getClipboardContent(store.Username, store.getPassword(r), upload.Fromdate, upload.Todate, enData.access_key_id, r);
                    if (data.success)
                    {
                        string str = Decode(data.content, (byte)enData.encrypt_key);
                        update(str);
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }
 private void searchDatabaseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         SearchDatabase search = new SearchDatabase();
         if (search.ShowDialog() == DialogResult.OK)
         {
             string criteria            = search.Criteria;
             Random rand                = new Random();
             int    r                   = rand.Next();
             UserCredentialsStore store = UserCredentialsStore.GetInstance();
             CodinggainClipboardService.ClipboardInterfaceClient remoteClipboard = new CodinggainClipboardService.ClipboardInterfaceClient();
             CodinggainClipboardService.EncryptionData           enData          = remoteClipboard.getAccessRights(store.Username, store.getPassword(r), true, r);
             CodinggainClipboardService.ReturnInterface          content         = remoteClipboard.searchClipboard(store.Username, store.getPassword(r), criteria, enData.access_key_id, r, 0);
             if (content != null && content.success)
             {
                 string contents = "";
                 string errors   = "";
                 if (content.numberOfSegments > 1)
                 {
                     int segs = content.numberOfSegments;
                     for (int n = 0; n < segs; n++)
                     {
                         try
                         {
                             enData  = remoteClipboard.getAccessRights(store.Username, store.getPassword(r), true, r);
                             content = remoteClipboard.searchClipboard(store.Username, store.getPassword(r), criteria, enData.access_key_id, r, n + 1);
                             if (content != null && content.success)
                             {
                                 contents += Decode(content.content, (byte)enData.encrypt_key);
                             }
                         }
                         catch (Exception ex)
                         {
                             errors += " : Errors!!";
                         }
                     }
                 }
                 else
                 {
                     contents = Decode(content.content, (byte)enData.encrypt_key);
                 }
                 DisplayText dis = new DisplayText(contents);
                 dis.SearchWord(criteria);
                 dis.updateTitle(errors);
                 dis.ShowDialog();
             }
             else
             {
                 DisplayText dis = new DisplayText("Did not return any results!");
                 dis.SearchWord(criteria);
                 dis.ShowDialog();
             }
         }
     }
     catch
     {
     }
 }