سلام خدمت کاربران وب سایت پروگرم 98 😉 در این مطلب آموزش ساخت فایل متنی با File.CreateText در c#.net را آماده کردم. امیدوارم که این کد برای شما مفید باشد.
کد ساخت فایل متنی با File.CreateText در c#.net :
using System;
using System.IO;
class MainClass
{
static void Main(string[] args)
{
StreamWriter MyStream = null;
string MyString = "Hello World";
try
{
MyStream = File.CreateText("MyFile.txt");
MyStream.Write(MyString);
}
catch (IOException e)
{
using System.IO;
class MainClass
{
static void Main(string[] args)
{
StreamWriter MyStream = null;
string MyString = "Hello World";
try
{
MyStream = File.CreateText("MyFile.txt");
MyStream.Write(MyString);
}
catch (IOException e)
{