c# create a text file
//File and path you want to create and write to
string fileName = @"C:\Temp\Temp.txt";
//Check if the file exists
if (!File.Exists(fileName))
{
// Create the file and use streamWriter to write text to it.
//If the file existence is not check, this will overwrite said file.
//Use the using block so the file can close and vairable disposed correctly
using (StreamWriter writer = File.CreateText(fileName))
{
writer.WriteLine("Hello World");
}
}
Also in C#:
- how to use variables in c#
- c# print to console
- check for collision unity c#
- C# graph api upload file one drive
- c# find index element array
- countdown script in unity
- c# clone stream
- how to parse a string to an integer c#
- check if two timespans intersect c#
- singleton unity
- c sharp string interpolation
- if else statement
- unity making homing rocket
- csharp check if env is development
- dynamic group by expression C#
- download and run exe c# 1 button
- create asp.net which send email and sms using own api
- c# initialize empty array
- unity rotate around axis
- C# webclient immitate browser
- c# clear console read chache
- how to deactivate objects through scripts in unity
- c# length of array
- create expression func c# for use in where clause