我想在我的HTML文件中寫入ASSETS文件夾。在ASSETS文件夾中寫入
請注意,因爲我的HTML與其他文件/文件夾有關,所以我無法使用個人文件夾。我必須在
資產/ HTML/mycharts.html寫
[MY WRITING code below return these errors
System.IO.File.WriteAllText("file:///android_asset/myGraphs/BarGraph.html", s);
]
錯誤
UNHANDLED EXCEPTION: System.IO.DirectoryNotFoundException: Could not find a part of the path "//file:///android_asset/myGraphs/BarGraph.html".
at System.IO.FileStream..ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool,System.IO.FileOptions) <0x00208>
at System.IO.FileStream..ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) <0x00057>
at System.IO.StreamWriter..ctor (string,bool,System.Text.Encoding,int) <0x00087>
at System.IO.StreamWriter..ctor (string,bool,System.Text.Encoding) <0x00037>
at
]
我能想到的最佳方法是從您的資產流式複製到您的文件,並在文件中引用您的HTML,而不是在您的資產中。 –
正確無誤地從資產流出。但更重要的是,我想不時在運行時動態更新我的資產?順便說一下,我們可以從(ASSETS/CONTENT/MYHTMLFILE.html)的其他地方託管HTML文件並使用WEBVIEW訪問它們? – Nicks