Skip to content

Instantly share code, notes, and snippets.

@sudotman
Created November 3, 2023 11:49
Show Gist options
  • Select an option

  • Save sudotman/8cd6c17fc85809998a962af1b2ab8c09 to your computer and use it in GitHub Desktop.

Select an option

Save sudotman/8cd6c17fc85809998a962af1b2ab8c09 to your computer and use it in GitHub Desktop.
Unity - Create a file in a custom folder on the Desktop
if(!Directory.Exists(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "\\ISROResults"))
{
Directory.CreateDirectory(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "\\ISROResults");
File.Create(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "\\ISROResults\\results.txt");
}
File.WriteAllText(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + "\\ISROResults\\results.txt", "Test1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment