|
|
And ears......
It turns out the code I posted demonstrating the difference between
Console.WriteLine("\\");
Console.WriteLine(@"\\");
doesn't work. There goes ~10 years of .net experience perhaps I should go back to asking people to switch it off and on again for a living
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
ahmad25 wrote: it does not work
that is not informative at all. if you want a good answer, then provide quality information to begin with. Don't say "it does not work", specify what kind of problem there is (compilation error, run-time error, ...) and be specific (error number, exception message, line number, etc).
|
|
|
|
|
this is my string: \u092A\u094B\u0937\u093E\u0939\u093E\u0930
i used this code:
string unicodeString = HttpUtility.HtmlEncode("\u092A\u094B\u0937\u093E\u0939\u093E\u0930");
MessageBox.Show(unicodeString);
it gives me answer correct as "POSHAHAR" IN HINDI FONT.
BUT if we use above text as string it gives
string unicodeString = HttpUtility.HtmlEncode(above_code);
MessageBox.Show(unicodeString);
the string takes value in this form: "\\u092A\\u094B\\u0937\\u093E\\u0939\\u093E\\u0930";
so, it can't work.
then my problem is , how am i replace "\\" instead of "\".
|
|
|
|
|
It is not as you said: in C# each string is unicode and something like "\u092A" is an escape sequence that mean "the unicode character with the code 0x092A. In other words, it is not a sequence of characters, but a single one.
|
|
|
|
|
Hi,
much better now, I understand you happen to have strings that hold Unicode characters in their \u format (as accepted by the C# compiler), and need them to be interpreted. I wasn't able to locate a .NET class that really supports this, so the best I could come up with is:
static string DecodeUnicode(string s) {
StringBuilder sb=new StringBuilder();
while (s.Length!=0) {
sb.Append((char)int.Parse(s.Substring(2, 4), NumberStyles.HexNumber));
s=s.Substring(6);
}
return sb.ToString();
}
which only accepts strings that consist of groups of six characters (a backslash, a 'u', and 4 hex digits); you may choose to add checks and error handling.
It works for your example.
string s="\\u092A\\u094B\\u0937\\u093E\\u0939\\u093E\\u0930";
log(s);
s=DecodeUnicode(s);
log(s);
FWIW: I think you got yourself into trouble; most of the time, you should simply avoid having to do this, and have the compiler translate those \uXXXX sequences into single characters!
PS: I'm not sure what HttpUtility.HtmlEncode is doing for you.
|
|
|
|
|
thank u very much,Luc Pattyn Sir!!
u r really solved my problem and i m very happy.
I always remember your suggestion.
thanx.
sorry for late reply.
|
|
|
|
|
|
Are you going to post the same question every single day? 'Coz if so, you missed out yesterday - were you ill? But I suppose the three versions you managed the day before covers that.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
what to do then,its my task.If i know how to do,why will i post message again and again.
|
|
|
|
|
sunithaganugu wrote: what to do then,its my task
Keeping asking the same question won't help either. You've been given valid answers, and you should be able to continue with your task. There won't be a cut/copy answer, so you'll have to write code and;
* research
* experiment
* try
Start of with a small console-app to convert a textfile to a PDF. Once you have that, move on to adding HTML-support.
Small steps.
I are Troll
|
|
|
|
|
Hello,I converted all formats to pdf and i got the output.I used aspose to convert.Actually its not a free tool..so im trying to do it without tool or by using some other tool..Im just asking suggestions right..So answer me if you know only....
|
|
|
|
|
sunithaganugu wrote: Actually its not a free tool..
As to be expected, those people put work into it - and they want to be paid for that.
sunithaganugu wrote: so im trying to do it without tool or by using some other tool..
There's no free tool that can read "all" file-formats and convert them to PDF. Other tools (like itextsharp) offer part of that functionality (writing to PDF), and you could use those (as suggested) to replace the Aspose library.
sunithaganugu wrote: So answer me if you know only....
You might not like the answer, but that isn't going to change it.
I are Troll
|
|
|
|
|
If it is your task then pick an option:
1) You have got a contract for work you know nothing about: return the money, and apologise.
2) You have got a job doing something you know nothing about: go to your boss, tell him / her and hope they give you extra time and / or help.
3) This is a homework assignment: Go to your tutor an tell him / her you don't know what to do. Ask for help.
Otherwise: Look at the answers you have (they aren't going to change because you post again, and again). Learnb from them, and try something. Experiment. Research. Learn. Stop looking for someone else to do your work for you, because that isn't going to happen.
Final option: Find a different career.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
sunithaganugu wrote: Please suggest how to convert word documents to pdf file using itextsharp.
The same as always, write a program that reads a word document and writes a PDF file using iTextSharp[^].
It's time for a new signature.
|
|
|
|
|
Hi,
When i run a application a small popup like login form will appear so if i login thn it will go to next page...or if i click the button cancel or close it that popup login it will disappear.
My task is... after login if i close the main application same login pop-up should come and after i login using my username and password should close the application completely.
My problem is.... i can able to do the same by above...but in that popup login form if i do close or cancel only that pop-up window should close not the complete application,,,,but now the complete application is getting closed due to the same login form. So wht is the solution for this ????
Hope you can understand my problem.
krishna
|
|
|
|
|
krishnavaradharajan wrote: but now the complete application is getting closed due to the same login form. So wht is the solution for this ????
Create the login form from your mainform. Next, show the login-form as a modal dialog.
The application closes as soon as the mainform closes (that's the one in the Program.cs file, in the Application.Run statement).
I are Troll
|
|
|
|
|
Ya i created in same way, thts y if i close login form mainform also getting closed...but it should not close the main form...only login form should get close.
Thanks
krishna
|
|
|
|
|
You should use Form.ShowDialog()[^] to display your login form from within your main form code.
It's time for a new signature.
|
|
|
|
|
Hi everybody,
I want to learn that, How may I execute/run following command using C#?
copy file.prn /b /lpt1
Thank you in advance
(Riaz)
|
|
|
|
|
You can use the Process.Start(...) method[^]. You just pass in "cmd" as the filename of the application and /c along with your command as the arguments:
String command = "copy file.prn /b /lpt1";
Process.Start("cmd", "/c " + command);
Simon
|
|
|
|
|
Thank you very much Mr. Simon p
|
|
|
|
|
i am working on excel application in which i need to download the data from excel.
while opening excel through application it always popup message as "Connecting to the server for information"
i want to disabled that meassage.
what i need to do..
i tried .DisplayAlerts = false; But its not working
modified on Thursday, July 29, 2010 2:21 AM
|
|
|
|
|
hi!
I have a xml file. in xml file contains data in below format.
ÂôáæãUæÚU.
I replace this text in unicode character. like :
092A for Â
094B for ô. and so on...
Actually I convert above xml file in HTML page. In HTML page the unicode character is shown as above.
"ÂôáæãUæÚU"-- this code means "POSHAHAR" in hindi. and I want to print POSHAHAR IN hindi.
please guide me what can I do. I am using C#.
thanx & Regards
|
|
|
|
|
Is there a control available for .Net (preferably with source - C# if possible) for selecting the columns of a fixed width text file?
I'm looking for something similar to Excel for the Text Import wizard (step 2 of 3) that provides the functionality for selecting the columns that the fields start.
Thanks,
cvogt61457
|
|
|
|