|
yes have the characters that are in the text,and i display data on the messagebox to show what's happen.
do u have any idea?
|
|
|
|
|
How do you decode the data before you show it in the message box?
---
b { font-weight: normal; }
|
|
|
|
|
I Decoded in same way i enocde these codepages
|
|
|
|
|
And how do you do that?
---
b { font-weight: normal; }
|
|
|
|
|
public string Display(string Str)
{
string UnicodeStr;
Encoding encGet3270Bytes;
Encoding UnicodeEnc = Encoding.Unicode;
Encoding ANSIArabic = Encoding.GetEncoding(1256);
Encoding Latin1 = Encoding.GetEncoding(1252);
Encoding OEMArabic = Encoding.GetEncoding(864);
#if CODEPAGE_1256
encGet3270Bytes = ANSIArabic;
#elif CODEPAGE_1252
encGet3270Bytes = Latin1;
#endif
byte[] cp864bytes = encGet3270Bytes.GetBytes(Str);
byte[] UnicodeBytes = Encoding.Convert(OEMArabic, UnicodeEnc, cp864bytes);
char[] UnicodeChars = new char[UnicodeEnc.GetCharCount(UnicodeBytes, 0, UnicodeBytes.Length)];
UnicodeEnc.GetChars(UnicodeBytes, 0, UnicodeBytes.Length, UnicodeChars, 0);
UnicodeStr = new string(UnicodeChars);
return UnicodeStr;
}
|
|
|
|
|
The code looks ok. You encode a string using 1256 or 1252 codepage, then decode it back to unicode. The only way I see that this would fail, is that the codepage does not support the characters in the string.
What characters is it that you have problem encoding?
---
b { font-weight: normal; }
|
|
|
|
|
I need To encode and decode arabic characters, do you have any suggestions?
|
|
|
|
|
Codepage 1256 supports arabic characters. Make sure that you are using that, and not codepage 1252.
---
b { font-weight: normal; }
|
|
|
|
|
I tried in both codepages , and not working.
|
|
|
|
|
Hello!
Can any body tel me abt the structure of .csproj file in solution of a .net project,As .csproj file is in xml
format and xmlserializer class is used to serialize a class or deserialize an xml file back to the orignal class.i want to read and save information of .csproj file into my own class bt as i dont know vat is the structure of this file so i m unable to get information from this file using deserialize method of xmlserializer class coz it needs the class info to which it is to be serialized.If anyone have any info abt this plz share with me
Thanks in advance!
Sam
|
|
|
|
|
i m also facing same kind of prolem!! can any1 tell us how 2 extract informaiton from .csproj using any way??
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
Well, .csproj is an MSBuild file. MSBuild is an XML format for build files, used from VS 2005 onwards. I guess you'll be better off writing your own parser using System.XML to parse out the Stuff you need from the MSBuild file[.csproj]. More Information is available here.
Yuvi Panda T
15 Year old Microsoft Student Partner
Blogs at : http://yuvipanda.blogspot.com
|
|
|
|
|
hi
I read html source code from a DB(Access), I want to load this page with click on a button , without create a file .
(in windows application C#.net)
thanks for your help
Salmani
|
|
|
|
|
what you mean by load file?
if you mean you want to load the file in browser without creating on disk,
well it can be done but with a trick like this:
Read the file from db(access) into string variable and then write that string variable into a temp html file and execute that htmlfile in browser, and after loading the file into browswer (may be 1 or 2 second delay be required) delete that temp html file
let see if this works
---------------------------
http://www.idlsol.com
|
|
|
|
|
I did it before, it works , but this solution ,for network with different permission may cause some problem.
I want load browser directly with htmltext, without create and save file.
|
|
|
|
|
well then you need to use memory stream as the source for the browser to read the html contents, but im not sure about this that either browser will read from this memory stream or not
what else can be done is you embed the browser control (if IE) in your application and then try to send html text to that browser control programmically
---------------------------
http://www.idlsol.com
|
|
|
|
|
memory stream!!
what do u mean by memory stream?
|
|
|
|
|
|
I read it, thanks, but there is a problem for using memory stream as a solution : how i can bind a memory stream file to a web browser??!!!
|
|
|
|
|
If you want to load HTML file in a webbrowser control, Its the straight forward way to set the property value of DocumentText of the Webbrowser with the HTML string.
Example,
If your Webbrowser control has instance name, webBrowserControlMyBrowser then
string htmlString = " Hello World ";
webBrowserControlMyBrowser.DocumentText = htmlString;
In this way, You dont need to create a file, save and delete etc, moreover, you dont even need to wait for couple of seconds to load. Its the DIRECT way.
Emran
|
|
|
|
|
Thanks. but im working with VisualStudio.net 2003, and this property "DocumentText" is not valid for web browser control!!!
Salmani
|
|
|
|
|
|
I tried all of them before, i searched all of sites and MSDN library , but i couldnt find it !
|
|
|
|
|
Hi
I please follow thease steps, I think it'll help you to solve the problem
first of all create a Windows application
drop a WebBrowser on form1 (leave the name webBrowser1)
change the Url property to about:blank
drop a button
double click on the button1 and paste this code for event handler
<code>
private void button1_Click(object sender, EventArgs e)
{
System.IO.MemoryStream st = new System.IO.MemoryStream ();
string sampleHtml = "<html><body>Hello world! </body></html>";
UTF8Encoding uniEncoding = new UTF8Encoding();
byte[] firstString = uniEncoding.GetBytes(
sampleHtml);
webBrowser1.DocumentStream = st;
st.Write(firstString, 0, firstString.Length);
st.Flush();
st.Position = 0;
webBrowser1.DocumentStream = st;
}
</code>
Ahmadreza Atighechi
|
|
|
|
|
Hi
Please do the following steps, I think it'll help you
Create a new windows application
Drop a WebBrowser Control to Form1 (leave the webBrowser1 as name)
change property Dock to none
change the property Url to about:blank
drop a button to form1 (leave the button1 as name)
bouble click on the button1 and paste following code as event handler
<code>
private void button1_Click(object sender, EventArgs e)
{
System.IO.MemoryStream st = new System.IO.MemoryStream ();
string sampleHtml = "<html><body>Hello world! </body></html>";
UTF8Encoding uniEncoding = new UTF8Encoding();
byte[] firstString = uniEncoding.GetBytes(
sampleHtml);
webBrowser1.DocumentStream = st;
st.Write(firstString, 0, firstString.Length);
st.Flush();
st.Position = 0;
webBrowser1.DocumentStream = st;
}
</code>
Ahmadreza Atighechi ..:--::..
|
|
|
|