先是使用读出内嵌资源.
Assembly assem =Assembly.GetExecutingAssembly ();
string[] str = assem.GetManifestResourceNames();
Stream stream = assem.GetManifestResourceStream(str[1]);//假设str[1]里面是我的资源文件名.然后.
StreamReader sr = new StreamReader(stream);
ApplicationClass app = new ApplicationClass();
app.Visible = false;
Workbook wb = app.Workbooks.Add(stream);
Console.Read();
编译文件报错.
类型不匹配。 (异常来自 HRESULT:0x80020005 (DISP_E_TYPEMISMATCH))请教一下.我应该如何正确的对读写其进行操作?
Assembly assem =Assembly.GetExecutingAssembly ();
string[] str = assem.GetManifestResourceNames();
Stream stream = assem.GetManifestResourceStream(str[1]);//假设str[1]里面是我的资源文件名.然后.
StreamReader sr = new StreamReader(stream);
ApplicationClass app = new ApplicationClass();
app.Visible = false;
Workbook wb = app.Workbooks.Add(stream);
Console.Read();
编译文件报错.
类型不匹配。 (异常来自 HRESULT:0x80020005 (DISP_E_TYPEMISMATCH))请教一下.我应该如何正确的对读写其进行操作?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货