如何从资源中打开文件 [英] How do I open a file from resources
本文介绍了如何从资源中打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的资源中添加了一个exe文件作为资源(比如test.exe)。
我想点击一下按钮打开它。
我不喜欢我不知道在button_click事件中我必须使用哪些代码。
谢谢。
I added an exe file as a resource in to my resources (like test.exe).
I want to open it by a button click.
I don't know what codes I have to use inside button_click event.
Thanks.
推荐答案
将其添加为资源,它将自动出现。如果它是一个文本文件,那么它是一个字符串:
Add it as a Resource and it will automatically appear. If it's a text file, then it's a string:
string s = Properties.Resources.MyFile;
名称为MyFile.txt
Where the name was "MyFile.txt"
这篇关于如何从资源中打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文