2014-03-12 109 views
0

在我問我的問題之前,我必須說我讀過MSDN網站,並且使用Using System;作爲namespaceUriBuilder命名空間

當我在我的代碼中使用類UriBuilderUsing System時,它是無效的。這個類的名字空間是什麼?

我使用Visual Studio 2008和我的操作系統爲Windows 7的

的代碼樣本

public partial class Form1 : Form 
{ 
    static public string AssemblyDirectory 
    { 
     get 
     { 
      string codeBase = Assembly.GetExecutingAssembly().CodeBase; 
      UriBuilder uri = new UriBuilder(codeBase); 
      string path = (uri.Path); 
      return Path.GetDirectoryName(path); 
     } 
    } 
+0

如果更換'UriBuilder'用'全球:: System.UriBuilder'會發生什麼? – Luaan

+0

沒有@Luaan。 – user3403967

+0

那麼,你需要有一個'System.dll'的引用,但我不明白你是否可以*看到它是一個Windows窗體應用程序等。*什麼是「不活躍」意味着什麼?它不會編譯?它打印出什麼錯誤? – Luaan

回答