示例#1
0
 /// <summary>
 /// 重新打包加密到新的文件 2018-03-29
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnRePack_Click(object sender, EventArgs e)
 {
     if (txtFileName.Text != "")
     {
         byte[] temp;
         if (myFileMessage.msgTP.canEdit)
         {
             temp = myFileMessage.RePack(txtNewUID.Text, txtNewID.Text, cboTpLevers.SelectedIndex, cboTpHearts.SelectedIndex);
         }
         else
         {
             temp = myFileMessage.RePack(txtNewUID.Text, txtNewID.Text, -1, -1);
         }
         FileStream   sro = new FileStream(this.FileFullName.Substring(0, this.FileFullName.Length - 4) + "-[" + DateTime.Now.ToString("yyyyMMddHHmmss") + "].bin", FileMode.Create);
         BinaryWriter w   = new BinaryWriter(sro);
         w.Write(temp);
         sro.Close();
         MessageBox.Show("OK");
     }
 }
示例#2
0
 /// <summary>
 /// 重新打包加密到新的文件 2018-01-30
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnRePack_Click(object sender, EventArgs e)
 {
     if (txtFileName.Text != "")
     {
         byte[]       temp = myFileMessage.RePack(txtNewUID.Text, txtNewID.Text);
         FileStream   sro  = new FileStream(this.FileFullName.Substring(0, this.FileFullName.Length - 4) + "-[" + txtNewUID.Text.ToUpper() + "].bin", FileMode.Create);
         BinaryWriter w    = new BinaryWriter(sro);
         w.Write(temp);
         sro.Close();
         MessageBox.Show("OK");
     }
 }