在C#WPF应用程序中将批处理文件用作资源
我想从我的资源中创建一个批处理文件 我知道为.exe文件创建文件的方法:在C#WPF应用程序中将批处理文件用作资源,c#,wpf,file,batch-file,C#,Wpf,File,Batch File,我想从我的资源中创建一个批处理文件 我知道为.exe文件创建文件的方法: byte [] resource_bytes = Project.Properties.Resources.exefile; File.WriteAllBytes(path, resource_bytes); 对于批处理文件,它的工作方式不同 有人有解决方案吗?windows批处理文件(bat)是文本文件,请尝试以下方法: if (!string.IsNullOrEmpty(text)) { File.Write
byte [] resource_bytes = Project.Properties.Resources.exefile;
File.WriteAllBytes(path, resource_bytes);
对于批处理文件,它的工作方式不同
有人有解决方案吗?windows
批处理文件(bat)
是文本文件,请尝试以下方法:
if (!string.IsNullOrEmpty(text))
{
File.WriteAllText(resourcePath, text);
}
else
{
MessageBox.Show("The Batch file is empty");
}
windows
批处理文件(bat)
是文本文件,请尝试以下操作:
if (!string.IsNullOrEmpty(text))
{
File.WriteAllText(resourcePath, text);
}
else
{
MessageBox.Show("The Batch file is empty");
}
批处理文件是一个简单的文本文件。批处理文件是一个简单的文本文件。