無法在 Windows CE 6.0 上刪除文件

無法在 Windows CE 6.0 上刪除文件

我最近在 Windows CE 6.0 上使用字型檔案(使用 C# Compact-Framework v2.0 和 AddFontResource 進行開發)。在添加“Angsana New”(泰語)後,我現在發現我加載的Angsana.ttf文件無法刪除!我已經嘗試了我能想到的一切,包括:

* Re-running my program and using RemoveFontResource
* Changing to another language that uses an in-built font or another I supply
* Renamed the file (which is allowed, why?
* Manually checking the registry to see if "Angsana" is referenced anywhere
* Power down the mobile device and back up again
* Loaded the Windows CE command prompt and used the command:
del /f Angsana.ttf

奇怪的是,我可以自由地將字體檔案從“Angsana.ttf”重命名為“Angsana_2.ttf”......但仍然無法刪除它。更有趣的是,如果我複製 Angsana.ttf(創建「Angsana.ttf 的副本」),那麼該副本也無法刪除!這是一個強烈的暗示,表明有一些屬性或系統進程鎖定了檔案(及其副本)......但是什麼?

來自資源管理器的錯誤訊息是:

"Cannot delete 'Angsana.ttf': There has been a sharing violation. The source or destination may be in use."

從命令提示字元來看,錯誤很簡單:

"Cannot remove Angsana.ttf"

到底他媽發生了什麼事?

更新:檔案「Angsana.ttf」位於名為「Fonts」的資料夾中。如果我在與「Fonts」同一層級建立一個名為「Fred」的新資料夾,我可以將 TTF 檔案剪下並貼上到新資料夾中。現在可以刪除新資料夾“Fred”,包括它包含的 TTF 檔案(或者如果失敗,重新啟動電源即可刪除整個資料夾)!

似乎我的行動裝置在啟動期間在字體資料夾上放置了某種「鎖定」(這是正確的術語嗎?)。

相關內容