怎么内制文件 怎么把EXE文件嵌在正在编写的程序里,并对他执行复制到指定目录的操作。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 添加一个Resource1.resx文件,然后使用“添加资源”--》“添加现在文件”我这里把系统自带的Notepad.exe加了进来 private bool WriteFile(byte[] pReadByte, string FileName) { FileStream fs = null; try { fs = new FileStream(FileName, FileMode.OpenOrCreate); fs.Write(pReadByte, 0, pReadByte.Length); } catch(Exception ex) { MessageBox.Show(ex.Message); return false; } finally { if (fs != null) fs.Close(); } return true; } private void button1_Click(object sender, EventArgs e) { System.Reflection.Assembly myAssembly; myAssembly = this.GetType().Assembly; //WindowsApplication1.Resource1 得修改成你的工程名称.资源文件名称 System.Resources.ResourceManager myManager = new System.Resources.ResourceManager("WindowsApplication1.Resource1", myAssembly); try { byte[] byteNotepad = (byte[])myManager.GetObject("notepad"); WriteFile(byteNotepad, @"d:\\Notepad.exe"); System.Diagnostics.Process.Start(@"d:\\Notepad.exe"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } 怎么用c#来发送邮件,winform下。 笨人求助:如题! 我想文本框里输入的只能是数字!请问如何用验证控件实现? 关于DATASET 中多个表的问题 【这个写法哪里不对?】 高手帮忙解决!急急急。。 文件内容修改 怎样在web应用程序中更新数据? C#中使用SQL Server分布式管理对象sqldmo.dll出错:"接口SQLDMO.Namelist 的 QueryInterface 失败"。示例http://www.ccw.com.cn/htm/cente WPF 图片中心旋转后如何缩放 存储过程的返回值怎么只有一位? 窗体1初始化的时候影藏显示窗体2
我这里把系统自带的Notepad.exe加了进来
private bool WriteFile(byte[] pReadByte, string FileName)
{
FileStream fs = null;
try
{
fs = new FileStream(FileName, FileMode.OpenOrCreate);
fs.Write(pReadByte, 0, pReadByte.Length);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return false;
}
finally
{
if (fs != null)
fs.Close(); }
return true;
} private void button1_Click(object sender, EventArgs e)
{
System.Reflection.Assembly myAssembly;
myAssembly = this.GetType().Assembly; //WindowsApplication1.Resource1 得修改成你的工程名称.资源文件名称
System.Resources.ResourceManager myManager = new System.Resources.ResourceManager("WindowsApplication1.Resource1", myAssembly); try
{
byte[] byteNotepad = (byte[])myManager.GetObject("notepad");
WriteFile(byteNotepad, @"d:\\Notepad.exe");
System.Diagnostics.Process.Start(@"d:\\Notepad.exe");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}