Hai....
I have the below code. if we run it, It will ask source path where our file with Telugu font later it will ask for destination path
to where we want to paste that Telugu font file. it will running properly. but i want the ASCII value for giving Telugu characterless
please help me....
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Web;
using System.IO;
using System.Windows.Forms; //we should add reference for this namespace
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//for (int i = 0; i < 1000; i++)
//{
// try
// {
// WebClient client = new WebClient();
// client.DownloadFile("http://www.99coverphotos.com/template/" + i + ".jpg", @"D:\99CoverPhotos\" + i + ".jpg");
// }
// catch
// {
// }
//}
//StreamReader sr = new StreamReader("d:\\t.txt",Encoding.UTF8);
//Console.WriteLine("?????? ??????");
//Console.WriteLine(sr.ReadToEnd());
//sr.Close();
FileStream fs = null;
try
{
string filePath = null;
while (true)
{
Console.WriteLine(@"Enter Your Telugu file path(egx:D:\telugu.txt)"+" \n\n After displaying the text in message box use mouse to click ok");
filePath = Console.ReadLine();
if (File.Exists(filePath))
break;
else
Console.WriteLine("File path does not exist, Please give proper file path");
}
fs = File.OpenRead(filePath);
byte[] bytes = new byte[fs.Length];
fs.Read(bytes, 0, Convert.ToInt32(fs.Length));
string text = System.Text.Encoding.Unicode.GetString(bytes);
//Console.WriteLine(text);
fs.Close();
MessageBox.Show(text);
Console.WriteLine(@"Enter destination File name(egx: D:\copiedFile.txt)");
string destFilePath = Console.ReadLine();
File.Copy(filePath, destFilePath);
Console.WriteLine("file copied");
}
catch (Exception ex)
{
Console.WriteLine("Exception occured : \n" + ex.Message);
}
finally
{
fs.Close();
}
Console.Read();
}
}
}
Thank you
in advance
Sravan kumar
Sra1