2013-04-09 91 views
1

過去2天Visual Studio很奇怪我已經重新安裝它,它並沒有解決我的問題。無法調用窗體和類,無法使用屬性。設置

我不能調用其他類或形式:

類: http://snag.gy/7W4dl.jpg

形式: http://snag.gy/lfm8Y.jpg

這並不讓我用Properties.Settings: http://snag.gy/W3VJn.jpg

代碼打開的mods形式:

private void button2_Click_1(object sender, EventArgs e) 
{ 
    Mods modsForm = new Mods(); 
    modsForm.ShowDialog(); 
} 

使用Properties.Settings和調用代碼類的東西

if (SAVE_UN_CHECK.Checked) 
{ 
    if (SAVE_UN_CHECK.Text != "") 
    { 
     string clearText = SAVE_UN_CHECK.Text.Trim(); 
     string cipherText = CryptorEngine.Encrypt(clearText, true); 

     //Save textbox text to file 
     Properties.Settings.Default.USER_USERNAME = cipherText; 
     USERNAME_TEXT.Text = cipherText; 
    } 
} 

怎麼辦?我從來沒有這些奇怪的錯誤。 我已經重新安裝了Visual Studio 2012和所有其他東西,如SQL Server的東西。 但它沒有解決問題。

這些using語句:

using System; 
using System.Collections.Generic; 
using System.Drawing; 
using System.Windows.Forms; 
using System.Threading; 
using System.ComponentModel; 
using System.Diagnostics; 
using System.IO; 
using System.Net; 
using System.Data; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
+0

你在文件的頂部是否有正確的使用語句? – 2013-04-09 12:17:54

+2

我希望每當我的代碼沒有編譯時,我可以簡單地重新安裝Visual Studio來修復它。 – 2013-04-09 12:17:56

+0

有可能缺少參考。 – ken2k 2013-04-09 12:19:04

回答

2

你必須添加一個引用到具有CryptorEngineMods類型的DLL。右鍵單擊該項目並選擇Add Reference...

然後您必須確保文件頂部的using語句指向定義CryptorEngineMods的命名空間。

+0

是的,修復了其中一個問題:D謝謝。 – 2013-04-09 12:24:54

+0

感謝它修復了所有的東西。現在我知道我需要引用他們:D謝謝!(ありがと!) – 2013-04-09 12:34:15