[C#] 读取嵌入到程序集中的资源文件 →→→→→进入此内容的聊天室

来自 , 2019-03-04, 写在 C#, 查看 136 次.
URL http://www.code666.cn/view/ec99dd0b
  1. Assembly assm = Assembly.GetAssembly(typeof(DatabaseCleanup));
  2. string file = "DatabaseCleanup.txt";
  3. Stream input = assm.GetManifestResourceStream("DataLoader.Resource" + "." + file);
  4. StreamReader reader=new StreamReader(input);
  5. string sql=reader.ReadToEnd();
  6. reader.Close();
  7. //csharp/194

回复 "读取嵌入到程序集中的资源文件"

这儿你可以回复上面这条便签

captcha