将资源文件中的数据写回磁盘
生活随笔
收集整理的這篇文章主要介紹了
将资源文件中的数据写回磁盘
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/// <summary> /// 將資源文件中的System.Data.SQLite.dll寫回磁盤 /// </summary> public static void WriteSqliteDriverToDisk() {Assembly assembly = AppDomain.CurrentDomain.GetAssemblies()[0];Stream stream = assembly.GetManifestResourceStream("XXX.System.Data.SQLite.dll");byte[] data = new byte[stream.Length];stream.Read(data, 0, data.Length);stream.Close();FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "System.Data.SQLite.dll", FileMode.CreateNew, FileAccess.Write);fs.Write(data, 0, data.Length);fs.Close(); }
轉載于:https://www.cnblogs.com/ssihc/archive/2010/08/31/1813951.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的将资源文件中的数据写回磁盘的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c++控制台下输出sin函数图形
- 下一篇: 抵御TCP的洪水