"file:///" file 協議

來源:互聯網
上載者:User

標籤:調試   sse   top   use   term   win7   appdata   one   本地   

【問題】 
在WLW中拖入本地圖片檔案,然後調試過程中,選中對應圖片,看到獲得的對應的html源碼中,圖片地址是這樣的: 
href="file:///C:/Users/CLi/AppData/Local/Temp/WindowsLiveWriter1627300719/supfiles52F410/wangdan-se-436963[2].jpg"> 
即使一個file加上一個冒號,再跟著三個斜杠的形式。 
想要搞懂這種寫法的確切含義。

【解決過程】 
1.搜“C# file colon three slash”找到這裡: 
http://bytes.com/topic/html-css/answers/154018-href-file-c-temp-target-_blank-c-temp-does-not-work-ie-anymore 
提到了說是file protocol,所以猜測估計是和http和ftp等價的某種file協議。

2.那就是和C#無關,那就去搜“file protocol colon three slash”,然後找到: 
http://www.urbandictionary.com/define.php?term=protocol%20section&defid=4118180 
解釋說:

The file (colon) // (slashes required) URL is good for accessing individual files. It has the ability to access the machine you’re using, or one you’re connected to, just by typing the path, in which you do file (colon) // then another slash (making 3), then in which you type a folder name, another slash, a folder inside that, and so on, until the file name. Hit enter, and the file is accessed.

總之,就是用file:///加上對應檔案的地址,開啟對應的本地電腦(或者你所串連到的電腦的 ->估計指的是像windows中映射出來其他近端分享中某個電腦為某個網盤的情況)中對應的檔案。

3.試了試,在Win7的資源管理員中,直接輸入: 
file:///C:/Users/CLi/AppData/Local/Temp/WindowsLiveWriter1627300719/supfiles52F410/wangdan-se-436963[2].jpg 
是可以開啟此圖片的。

【總結】 
用file:///+檔案的地址,其實就等價於檔案的地址, 
即: 
file:///C:/Users/CLi/AppData/Local/Temp/WindowsLiveWriter1627300719/supfiles52F410/wangdan-se-436963[2].jpg 
其實就等價於; 
C:/Users/CLi/AppData/Local/Temp/WindowsLiveWriter1627300719/supfiles52F410/wangdan-se-436963[2].jpg 
使得(此處Html源碼中所允許的地址,對應的WLW程式)可以訪問對應的檔案而已。

"file:///" file 協議

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.