Witam
Mam taki kod:
private void Button2_Click(object sender, EventArgs e)
{
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream resourceStream = assembly.GetManifestResourceStream("Resources.example.txt"))
{
if (resourceStream != null)
{
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string filePath = Path.Combine(desktopPath, "example.txt");
using (FileStream fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
{
resourceStream.CopyTo(fileStream);
}
}
}
}
Powinien on zapisać plik example.txt z zasobów na pulpit, a tego nie robi. Proszę o pomoc