https://stackoverflow.com/questions/5750203/how-to-write-unicode-characters-to-the-console
using System;
using System.Diagnostics;
using System.Windows.Forms;
using System.Net.Mail;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
//Read a Text File
//using System;
//using System.IO;
namespace readwriteapp
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
String line;
try
{
//Pass the file path and file name to the StreamReader constructor
// StreamReader sr = new StreamReader("d:\\config2.ini", Encoding.Unicode, true);
StreamReader sr = new StreamReader("d:\\config2.ini");
//Read the first line of text
line = sr.ReadLine();
//Continue to read until you reach end of file
Console.OutputEncoding = System.Text.Encoding.UTF8;
while (line != null)
{
//write the lie to console window
Console.WriteLine(line);
//Read the next line
line = sr.ReadLine();
}
//close the file
sr.Close();
Console.ReadLine();
}
catch(Exception e)
{
Console.WriteLine("Exception: " + e.Message);
}
finally
{
Console.WriteLine("Executing finally block.");
}
}
}
}
//static void Main(){}
/*
//Write a text file - Version 2
//using System;
//using System.IO;
//using System.Text;
namespace readwriteapp
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Int64 x;
try
{
//Open the File
StreamWriter sw = new StreamWriter("d:\\config2.ini", true, Encoding.Unicode);
//Writeout the numbers 1 to 10 on the same line.
for(x=0; x < 10; x++)
{
sw.Write(x);
}
sw.Write("Ћирилица Караџића Вука");
//close the file
sw.Close();
}
catch(Exception e)
{
Console.WriteLine("ExceptionW: " + e.Message);
}
finally
{
Console.WriteLine("ExecutingW finally block.");
}
String line;
try
{
//Pass the file path and file name to the StreamReader constructor
StreamReader sr = new StreamReader("d:\\config2.ini");
//Read the first line of text
line = sr.ReadLine();
//Continue to read until you reach end of file
while (line != null)
{
//write the lie to console window
Console.WriteLine(line);
//Read the next line
line = sr.ReadLine();
}
//close the file
sr.Close();
Console.ReadLine();
}
catch(Exception e)
{
Console.WriteLine("Exception: " + e.Message);
}
finally
{
Console.WriteLine("Executing finally block.");
}
}
}
}
*/
https://zeljko.popivoda.com/linux-lite/
https://beogradsko.blogspot.com/2020/07/postanite-profesionalni-programer-na.html
https://beogradsko.blogspot.com/2020/07/postanite-profesionalni-programer-na.html
No comments:
Post a Comment
Beogradsko programiranje=