|
Let me try that piece out... Looks interesting. It has something to do with the number of bytes in a character. The "old" ASCII uses 7 bits, while UTF8, you guessed it uses 8 bits. But it doesn't really explain why you get the weird character at the beginning.
Have you tried looking up some info about text encoding on google?
|
|
|
|
|
Yes, I've tried to find some hints on Google but without success.
Console.WriteLine(new StreamReader(stream).ReadToEnd());
works correct.
|
|
|
|
|
when you create a stream or file in UTF8 or in Unicode, it will start with a 2-byte
indication of the encoding; in your case it is 0xFE 0xBB. Only then will appear the
first "real" character (0x3C for <).
If you write to file, then open the file in a text editor, both cases work just fine,
because the editor consumes the optional 2-byte to understand how it needs to interpret
the remainder.
Your reading code however does not discover the encoding, it has that information baked
into the code, so it treats the 0xFE oxBB as real characters and since they are not
really printable (above 0x7E), it turns them into a single question mark.
|
|
|
|
|
hi, i am trying to implement magnification just like ACDC. Any one can guide me about magnification algorithm.
i will b thankful to you.
regards,
|
|
|
|
|
it doesn't have any special algorithm. you can use .net methods (antialiasing enabled) to do it.
simply create a panel and on paint event use e.Graphics.DrawImage() method to draw your image in your panel that larged according the zoom when e.i. + key pressed.
-- modified at 10:32 Tuesday 3rd July, 2007
modified 8-Jan-14 3:11am.
|
|
|
|
|
Hi, thanks a lot for your reply. Actually I am using the same method as you have described but it is bit slow and getting complex. Because I have to draw the whole drawing again. Have u seen such kind of code or any sample. Plz let me know I will be very thankful to you.
Regards,
|
|
|
|
|
i am having the text boxes in my application.
after running my application, i fill values in these text boxes.
now i want to print the values of these text boxes.
how can i.please send me the code.
hhhhhhhhhh
|
|
|
|
|
|
Hi there,
I encountered some authentification issue.I have a window application in C#, having program which is calling web services, but I receive a log file said "Error Message: The remote server returned an error: (401) Unauthorized.". What I need to do is to pass credential of NT Login ID and password, then only I am able to access the websservice. Can anyone walk through my coding, any line or command is missing? How i can pass the credential along?
...
string boundaryString = Guid.NewGuid().ToString("N");
string boundaryLine = "--" + boundaryString + "\r\n";
Uri uri = new Uri(requestUri);
HttpWebRequest request;
request = (HttpWebRequest)WebRequest.Create(uri);
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
request.ContentType = "text/plain; boundary=" + boundaryString;
request.Method = "POST";
...
thanks,
Lee Chuang
|
|
|
|
|
|
Thanks for reply. The content of the link is talking about the using Client Certification. But over my side, I am using service account (NT Login Account) for the credential. My NT login is known by the opposite server. So when I run the web service, remote server knows my present to the service. But bad news is I am not sure how to make my code carry along with the credential.
really need more help...
thanks,
Lee Chuang.
|
|
|
|
|
hi everybody
I wanna to know how to generate a pdf report by code using c#.net
thank's 
|
|
|
|
|
|
Error: 80045901 Initializing SQL Server Reconciler failed. Minor error: 29045.
This is what I recieve when trying to sync with the SQL
server from my Pocket PC emulator. I register sscerp20.dll by using regsvr32 "C:\Program Files\Microsoft SQL Server CE 2.0\Server\sscerp20.dll. That hasn't
helped. Has anyone else seen this issue
or perhaps,found a solution for it?
Please help me
Thx,
fakhirov
|
|
|
|
|
Ols check with your SQL Server login name and password and try again.
this is caused because of that problem only.
Regards,
Satips.
|
|
|
|
|
hi,
I want to convert a word to pdf with tx text control but I have an error:
The following control could not be licensed: TXTextControl.ServerTextControl
The code I use is:
TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl();<br />
tx.Create();
please help.
thanks
|
|
|
|
|
It seems that you don't have valid license. Perhaps you need to purchase it
|
|
|
|
|
Hi,
I am a self taught programmer who just knows there must be a simpler way of doing this:
<br />
DataRow[] drx = this.myWebLoggerDataSet.Tables["MonitorList"].Select("DBMonitorNumber = '" +gbi.ToString() +"'");<br />
gbMonitoredItem[gbi].Text = drx[0]["Name"].ToString();
Surely I don't need to use a DataRow to achieve this?
I can't figure out anything simpler though.
TIA.
Glen Harvy
|
|
|
|
|
If I'm not missing something, then there is really no simpler way as long as you stick to untyped DataSets.
With a typed DataSet it would be a bit simpler:
gbMonitoredItem[gbi].Text = this.myWebLoggerDataSet.MonitorList.FindByMonitorNumber(gbi).Name
In typed DataSets you have also the possibility to add your custom code (partial classes).
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
He'll still have to deal with DataRow objects (or rather objects derived from DataRow) at some point - it will just be hidden away.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Ok - that fills in the gaps in my broken knowledge
I could use that but I would need to index that column etc so at the end of the day it's probably just as easy to do it "the long way".
Linq does look to be the eventual simplification.
Thanks for the pointer - much appreciated.
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: Surely I don't need to use a DataRow to achieve this?
It seems sensible for me that the Select method returns an array of DataRow objects.
Glen Harvy wrote: I can't figure out anything simpler though.
Because it isn't available yet. LINQ is probably what you are looking for. It will be available in Visual Studio 2008 ("Orcas")
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
I just thought it was overkill as I know only one row will be rerurned (I could have used find I guess).
Linq is probably the answer of course.
Thanks for your input - much appreciated.
Glen Harvy
|
|
|
|
|
How to create controls dynamically?
|
|
|
|
|
Control c = new Control();
All the best,
Martin
|
|
|
|