將microsoft.windowsapicodepack.dll、microsoft.windowsapicodepack.shell.dll 加入專案中,編寫如下xaml **,兩個用來顯示known folders 和libraries 選項。
<在c# 中加入如下命名空間,shell 用於支援載入公共資料夾,dialogs用於呼叫資料夾對話方塊。grid
>
<
label
content
="know folders:"
height
="30"
width
="100"
margin
="47,70,356,211" />
<
label
content
="libraries:"
height
="30"
width
="100"
margin
="48,191,355,90" />
<
combobox x:
name
="knowfolders"
width
="200"
height
="25"
margin
="186,70,117,211" />
<
combobox x:
name
="libraries"
width
="200"
height
="25"
margin
="186,190,117,90" />
<
button x:
name
="openkf"
click
="openkf_click"
content
="open dialog"
height
="30"
width
="90"
margin
="296,126,116,155" />
<
button x:
name
="openlb"
click
="openlb_click"
content
="open dialog"
height
="30"
width
="90"
margin
="296,250,117,31" />
grid
>
using microsoft.windowsapicodepack.shell;接下了編寫乙個combobox 載入方法填充上面提到的兩個內容,通過iknownfolder 介面獲取所有knownfolders 類中的系統已知資料夾。using microsoft.windowsapicodepack.dialogs;
private void loadcombox()known foloder 「open dialog」 按鈕click 事件,通過commonopenfiledialog 類建立對話方塊,將knowfolder 初始化為shellcontainer。}if (knowfolders.items.count > 0)
libraries.items.clear();
libraries.items.add("documents");
libraries.items.add("music");
libraries.items.add("pictures");
libraries.items.add("videos");
libraries.selectedindex = 0;
}
private void openkf_click(object sender, routedeventargs e)libraries 「open dialog」 按鈕click 事件:
private void openlb_click(object sender, routedeventargs e)編譯測試:commonopenfiledialog cfd = new
commonopenfiledialog();
cfd.ensurereadonly = true;
cfd.initialdirectoryshellcontainer = selectedfolder;
cfd.showdialog();
}
Windows 7 公共資料夾對話方塊
將microsoft.windowsapicodepack.dll microsoft.windowsapicodepack.shell.dll 加入專案中,編寫如下xaml 兩個用來顯示known folders 和libraries 選項。grid label content know fold...
Windows 7 公共資料夾對話方塊
將microsoft.windowsapicodepack.dll microsoft.windowsapicodepack.shell.dll 加入專案中,編寫如下xaml 兩個用來顯示known folders 和libraries 選項。grid label content know fold...
Windows 7 資料夾共享
今天搞了下windows 7下的檔案共享,總是搞不定,雖然以前也偶爾有成功過,但未作記錄,現在要搞一時搞不定,所以決定好好記錄一下。win7的資料夾共享搞得實在是太麻煩了 對於一般使用者而言 為了許可權控制,搞了太多的選項,煩,一般人如果採用預設設定,一定是無法共享的,除了本機外,其他機器是無法正常...