Click here to Skip to main content
15,890,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating sql database by using Link???? Pin
omegazafer9-Feb-09 0:01
omegazafer9-Feb-09 0:01 
AnswerRe: Creating sql database by using Link???? Pin
Ken Mazaika9-Feb-09 2:34
Ken Mazaika9-Feb-09 2:34 
GeneralRe: Creating sql database by using Link???? Pin
omegazafer10-Feb-09 22:06
omegazafer10-Feb-09 22:06 
Questiondata transfer from MsAccess to Mysql Pin
anishkannan8-Feb-09 20:52
anishkannan8-Feb-09 20:52 
AnswerRe: data transfer from MsAccess to Mysql Pin
N a v a n e e t h8-Feb-09 22:01
N a v a n e e t h8-Feb-09 22:01 
QuestionHow to generate XML File using XSD and Excel(XSL) File in C# Pin
am 20098-Feb-09 20:37
am 20098-Feb-09 20:37 
AnswerRe: How to generate XML File using XSD and Excel(XSL) File in C# Pin
Ken Mazaika9-Feb-09 2:23
Ken Mazaika9-Feb-09 2:23 
QuestionThe specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.in C# Pin
ChandrakanthGaddam8-Feb-09 20:16
ChandrakanthGaddam8-Feb-09 20:16 
Hi,

This is from Chandrakanth. working on C# with Asp.net.

Actually i have one problem ,

That is While copying the data from

Copy(Source File,DestinationFile) gettting "Ilegal charcters in a path"


Actually what we are doing is Converting Tiff File To TextFile through OCR.

I am getting data INTO STRING from Conversion from tiff to txt throgu OCR.

And Renaming the file with .txt.

And i want to move the data from STRING to txtFile.

Can any one tell me what to do for that.

That Code and all i am giving here .




string strFilePath = FileUpload1.PostedFile.FileName;
Process tessProc = new Process();
tessProc.StartInfo.WorkingDirectory = strFilePath; // @"C:\08122008_NY01_AST_1.0.tif"; // strFileName;
tessProc.StartInfo.FileName = @"D:\Chandrakanth\TesseractOCR08022009\bin.dbg\tesseract.exe";
string strFileName1;
int intLastIndexOfSlash;
if (strFilePath.IndexOf(@"\") == 0)
strFileName1 = strFilePath;
else
{
intLastIndexOfSlash = strFilePath.LastIndexOf(@"\");
strFileName1 = strFilePath.Substring(intLastIndexOfSlash + 1);
}
tessProc.StartInfo.Arguments = strFileName1 + " output"; tessProc.Start();
string output = File.ReadAllText(@"C:\output.txt");
TextBox1.Text = output;

string strOutPutFileName = System.IO.Path.GetFileNameWithoutExtension (strFileName1) + ".TXT";
string strSaveFilePath = Server.MapPath("");
File.Create(strSaveFilePath + @"\" + strOutPutFileName);
string illegal = output;
string regexSearch = string.Format("{0}{1}",
new string(Path.GetInvalidFileNameChars()),
new string(Path.GetInvalidPathChars()));
Regex r = new Regex(string.Format("[{0}]", Regex.Escape(regexSearch)));
illegal = r.Replace(illegal, "");

System.IO.File.Copy(illegal, strOutPutFileName);

Actually that illegal contains data in below format

------------------------------------------------------------------------

JMW -J
'me l^ T
l ii T T ASTER
^ WE INTEGRATE CDMIUIYICJTIOIVS
INVOIC E
ASTER TELE SERVICES FVT. LTD, Invoice No: EMHASDCGSE
Flat na.4 to 7, C/a Krlshna Plaza, Date: 13-Dec417 ,
Opp.WaLer Tanks, Near TATA Garden Busstop, .
Chandan Nagar, PUNE-14
PAN No AACCA54E9L P.O.NG: 4352
CST TIN is 2715000524SC w e.l01 04.2005 Date: MAMGY-W
\lAT TIN is 2715000524GV wel`01 O4 ZODG
ST Regn No. AACCAMSBLSTOUT
Kg Vodafnile Essar Cellular Lid.,
.)Mutropnlltan, F/P Null.
S,No. 21, Old Mumbalrvurla Highway,
Wakzdewadljhivaji Nagar, Site Name: Gad Mudslngi
PUNE 7 411005 TowsrType R1~l
Tower Height: 21 Mts
Natllreof Workmvaition Lamp, Llghting Arrester
EETEHWKJJMS lure lu. a' value la;.
1 Aviation lain 1 @1 avov s woo
Z Li htin Arrester 1 Nas ' 1SD(l 1,600
a Avlaiulun lam came XI arm no la are

1 ** . _
1 ]*__
1 ___ an svo
rli= anuue `rum include sel-vlces tax Amount of ns see _
I `rural niu==i== Value as eve
?
JJ Now Claimed nuowi. of xiivaiue value is slo
(Rupees Thirteen Thousand Slx Hundred and Seventy un!y)
For ASTER TELE SERVICES PVT LTD 7
/ ^ i
Aurlu=rls= slguauiry I
4

ASTER TELESERVICES PVILTD.
4~7 Krlshnla Pbxa, Opp. WalerTarll<, NearTaln Garden Bus Slap, Otlendan Nsgar, Fune -41l 014
2* Phone :(Qll) 020 - 21034495, 323445413, 32,540369, Tetetax : 020 ~ 21034495.


-------------------------------------------------------------------------

System.IO.File.Copy(illegal, strOutPutFileName);

Actually i want to move the data from illegal to strOutPutFileName

here i am getting error

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

for this line

System.IO.File.Copy(illegal, strOutPutFileName);


Can anyb one tell how to do that ASAP?


Thanks and Regards
Chandrakanth
AnswerRe: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.in C# Pin
Christian Graus8-Feb-09 20:24
protectorChristian Graus8-Feb-09 20:24 
GeneralRe: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.in C# Pin
ChandrakanthGaddam8-Feb-09 20:31
ChandrakanthGaddam8-Feb-09 20:31 
JokeRe: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.in C# Pin
Le centriste9-Feb-09 4:56
Le centriste9-Feb-09 4:56 
QuestionExtracting outlook pst files in..net application Pin
Member 42634168-Feb-09 20:12
Member 42634168-Feb-09 20:12 
AnswerRe: Extracting outlook pst files in..net application Pin
Mickey202931-Oct-12 22:50
Mickey202931-Oct-12 22:50 
QuestionWeb Browser control in C# Pin
Indrajeet_Mukherjee8-Feb-09 19:39
Indrajeet_Mukherjee8-Feb-09 19:39 
AnswerRe: Web Browser control in C# Pin
EliottA9-Feb-09 2:03
EliottA9-Feb-09 2:03 
Questioneverything is an object... Pin
swjam8-Feb-09 19:32
swjam8-Feb-09 19:32 
AnswerRe: everything is an object... Pin
Christian Graus8-Feb-09 19:51
protectorChristian Graus8-Feb-09 19:51 
AnswerRe: everything is an object... PinPopular
Guffa8-Feb-09 20:28
Guffa8-Feb-09 20:28 
GeneralRe: everything is an object... Pin
marcosingh22-Jan-11 4:25
marcosingh22-Jan-11 4:25 
AnswerRe: everything is an object... Pin
ABitSmart8-Feb-09 23:08
ABitSmart8-Feb-09 23:08 
GeneralRe: everything is an object... Pin
swjam8-Feb-09 23:13
swjam8-Feb-09 23:13 
GeneralRe: everything is an object... Pin
ABitSmart8-Feb-09 23:30
ABitSmart8-Feb-09 23:30 
GeneralRe: everything is an object... Pin
N a v a n e e t h8-Feb-09 23:39
N a v a n e e t h8-Feb-09 23:39 
GeneralRe: everything is an object... Pin
swjam8-Feb-09 23:50
swjam8-Feb-09 23:50 
GeneralRe: everything is an object... Pin
J4amieC9-Feb-09 0:05
J4amieC9-Feb-09 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.