我從一個測試應用程序複製了一些代碼:如何在Windows CE設備上指定文件的路徑?
const string sdfPath = @"C:\WebAPIClient\WebAPIClient\bin\Debug\DBPlatypusCompactDB.sdf";
string dataSource = string.Format("Data Source={0}", sdfPath);
int countAdded = 0;
if (!File.Exists(sdfPath))
. . .
...工作正常那裏。但是,試圖將其轉換用於將Windows CE設備上運行的項目:
const string sdfPath = @"Computer\WindowsCE\\\Program Files\hhs\DBPlatypusCompactDB.sdf";
. . .
...(這是我從Windows資源管理器(這是該exe文件的部署文件夾複製的路徑,沒有子文件夾)),我得到「路徑找不到」或「路徑無效」或類似的東西。
我該如何指定路徑?
「計算機」 * *是什麼Windows資源管理器在桌面上說,但是從設備本身,這是「\\ Program Files文件\\ HHS \ DBPlatypus.sdf 「而且工作正常;謝謝! –
Windows CE不理解相對路徑,因爲在Windows CE中沒有「當前目錄進程」的概念。 –