2014-10-11 63 views
-1

我使用DiskCryptor首次和我很喜歡,我可以用熱鍵用來執行的安裝一個.EXE我加密分區。使一個.EXE執行批處理cmd,然後在某一點提示輸入

加密的驅動器都只是我的數據驅動器/分區,而不是我的操作系統分區(Windows 7)中,他們都有着相同的加密。 我現在的.exe文件只是一個批處理文件CMD,其安裝的所有驅動器並加載從預定義的位置,這是一個加密的USB盤的根目錄,指定J A密鑰文件:\

但是我真的想添加一個密碼,我必須手動輸入,而不必將其存儲在緩存中的任何位置或以任何方式記住,但dcrypt軟件似乎沒有內置提示功能,小窗口或cmd提示符,我可以輸入我的密碼密碼。

我有啓動其鎖定使用Screenblur系統並且使用dccon.exe在一個未加密的分區卸載所有驅動器另外兩個快捷鍵的宏熱鍵。如果加密的usb驅動器與密鑰文件和dcrypt插入到我的電腦中,則在其下安裝所有驅動器的cmd。

j:\ dcrypt \ dccon.exe」 -mountall -kf j:\鍵-p 「」

我想.EXE以提示輸入其之間插入了 「」 而如果可能,如果沒有找到「J:\ key」文件,請提示一個窗口,讓我瀏覽以手動查找正確的文件(最好是隻有輸入字段並輸入按鈕的窗口)。不是程序員,所以我非常希望能夠實現這個目標.. 從我得到的東西其實非常簡單,如果有人知道了,或許你可能會像編寫我需要的幾行代碼,併發布代碼以及如何o編譯是否正確?

會很感激這一點,許多在此先感謝任何形式的靈魂在那裏!

請 -st0rm

+0

因此不要求代碼正確的地方爲你寫。這是關於*編程的問題,而不是發佈要求。 – skrrgwasme 2014-10-11 20:48:06

+0

嗯,我在問代碼應該是什麼,但好的..你會建議我問什麼呢? – st0rm 2014-10-11 20:54:02

+0

您的評論強調了我的觀點......您要求提供完整的代碼。如果你已經編寫了程序的大部分內容,只需要一步的幫助,但是你要求某人編寫整個程序*並告訴你如何編譯它,那將是不同的。這不是那種要求的。我唯一的建議是把它作爲一個自由職業者的項目。com或其他一些工程承包網站。 – skrrgwasme 2014-10-11 21:05:26

回答

0

我就在那心情......

所以這是啤酒軟件...隨時給我買啤酒,如果我們曾經見過...

C#

的app.config:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
     <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 
      <section name="WindowsFormsApplication2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
     </sectionGroup> 
    </configSections> 
    <applicationSettings> 
     <WindowsFormsApplication2.Properties.Settings> 
      <setting name="path_to_dccon_exe" serializeAs="String"> 
       <value>J:\dcrypt\dccon.exe</value> 
      </setting> 
      <setting name="parameters_for_dccon_exe" serializeAs="String"> 
       <value>-mountall -kf J:\key -p "{0}"</value> 
      </setting> 
     </WindowsFormsApplication2.Properties.Settings> 
    </applicationSettings> 
</configuration> 

Form1.cs中

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 

namespace WindowsFormsApplication2 
{ 
    public partial class Form1 : Form 
    { 
     public Form1() 
     { 
      InitializeComponent(); 
     } 

     private void button1_Click(object sender, EventArgs e) 
     { 
      try 
      { 
       System.Diagnostics.Process.Start(Properties.Settings.Default.path_to_dccon_exe, string.Format(Properties.Settings.Default.parameters_for_dccon_exe, textBox1.Text)); 
      } 
      catch (Exception ex) 
      { 
       MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "Exception"); 
      } 
     } 

     /// <summary> 
     /// Required designer variable. 
     /// </summary> 
     private System.ComponentModel.IContainer components = null; 

     /// <summary> 
     /// Clean up any resources being used. 
     /// </summary> 
     /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> 
     protected override void Dispose(bool disposing) 
     { 
      if (disposing && (components != null)) 
      { 
       components.Dispose(); 
      } 
      base.Dispose(disposing); 
     } 

     #region Windows Form Designer generated code 

     /// <summary> 
     /// Required method for Designer support - do not modify 
     /// the contents of this method with the code editor. 
     /// </summary> 
     private void InitializeComponent() 
     { 
      this.button1 = new System.Windows.Forms.Button(); 
      this.textBox1 = new System.Windows.Forms.TextBox(); 
      this.SuspendLayout(); 
      // 
      // button1 
      // 
      this.button1.Location = new System.Drawing.Point(152, 10); 
      this.button1.Name = "button1"; 
      this.button1.Size = new System.Drawing.Size(75, 23); 
      this.button1.TabIndex = 1; 
      this.button1.Text = "OK"; 
      this.button1.UseVisualStyleBackColor = true; 
      this.button1.Click += new System.EventHandler(this.button1_Click); 
      // 
      // textBox1 
      // 
      this.textBox1.Location = new System.Drawing.Point(46, 12); 
      this.textBox1.Name = "textBox1"; 
      this.textBox1.PasswordChar = '*'; 
      this.textBox1.Size = new System.Drawing.Size(100, 20); 
      this.textBox1.TabIndex = 2; 
      // 
      // Form1 
      // 
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 
      this.ClientSize = new System.Drawing.Size(272, 42); 
      this.Controls.Add(this.textBox1); 
      this.Controls.Add(this.button1); 
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 
      this.Name = "Form1"; 
      this.Text = "unsuspicious Application"; 
      this.ResumeLayout(false); 
      this.PerformLayout(); 

     } 

     #endregion 

     private System.Windows.Forms.Button button1; 
     private System.Windows.Forms.TextBox textBox1; 

    } 
} 

編輯:所以...這是我寫的......好吧,除了從上扔2個控制和安排他們

  try 
      { 
       System.Diagnostics.Process.Start(Properties.Settings.Default.path_to_dccon_exe, string.Format(Properties.Settings.Default.parameters_for_dccon_exe, textBox1.Text)); 
      } 
      catch (Exception ex) 
      { 
       MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "Exception"); 
      } 
+0

噢,我的天啊,非常感謝你!我從字面上相信這只是幾行代碼,談論無知!這真棒,你是最棒的。如果你曾經在丹麥,我一定會給你買一箱啤酒:)明天我就編譯它 – st0rm 2014-10-11 23:17:12

+0

它真的只是幾行代碼......這裏的大多數是IDE生成的鍋爐板代碼...準確地說,一切都歸結爲button1_Click方法...整個休息都是由Visual Studio生成的,而我正在將一個文本框和一個按鈕放到一個窗體上...在app.config中您可以修改參數字符串{0}中dccon.exe ...的路徑和參數/參數將被您輸入該文本框的任何內容替換 – DarkSquirrel42 2014-10-11 23:34:40

相關問題