|
new System.IO.StreamReader(temp_path, Encoding.ASCII)
---
b { font-weight: normal; }
|
|
|
|
|
The 'guess' is on
|
|
|
|
|
the source file(.txt) is encoding with ASCII
i need read this file and display it in a web page
|
|
|
|
|
634768511 601989262 ˵(2005-07-09 18:42:55)Ϊ˱֤MM˵İȫ뱣ܡ鿴QQ502278472ĸ֪ô
634768511 601989262 ˵(2005-07-09 18:42:55)Ϊ˱֤MM˵İȫ뱣ܡ鿴QQ502278472ĸ֪ô
now i see this,see??
|
|
|
|
|
rainfeet wrote: file_context += temp_string + "
";
Either do:
file_context += temp_string + @"
";
-or-
file_context += temp_string + Environment.NewLine;
|
|
|
|
|
3Q
|
|
|
|
|
there are two ways to slove this problem.
first is that after you read the bytes,then you convert it to unicode :
string temp_string = sr.ReadLine();
// Create two different encodings.
Encoding ascii = Encoding.ASCII;
Encoding unicode = Encoding.Unicode;
// Convert the string into a byte[].
byte[] assciiBytes = unicode.GetBytes(temp_string );
// Perform the conversion from one encoding to the other.
byte[] unicodeBytes = Encoding.Convert(unicode, ascii, assciiBytes );
the second is that initalize the StreamReader with unicode:
using(System.IO.StreamReader sr = new System.IO.StreamReader(temp_path, Encoding.Unicode))
{
}
Just do it!
|
|
|
|
|
i am sorry to tell you
634768511 ?? 601989262 ??(2005-07-09 18:42:55)????????????????????????????????????
i see this
|
|
|
|
|
Please guide me in the following scenario
I am developing c# application using Visual Studio 2005. I want that when the user executes my application then:
1- The window should create a new Virtual desktop using MSVD.
2- My application should run in the new desktop. Only my application should be allowed to run.
3- I should have the options to modify the start menu in the new virtual desktop
4- When user close application the virtual desktop should shutdown
How can I achieve this?
I will be very thankful.
|
|
|
|
|
Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
What could be the reason for the error.
where there is a will there is a way
|
|
|
|
|
This error may occurs when the object is not inilized.
Use this:
myClass myObject = new myClass();
OR
myClass myObject = null;
myObject = new myClass();
|
|
|
|
|
ZeeshanAhmedpk wrote: myClass myObject = null;
myObject = new myClass();
Why this?
|
|
|
|
|
Its null reference because you havent instantiated or assigned to an instance.
Why it throws an exception is because you using even though it is null reference.
Hope this answers your question..
.NET Rules
|
|
|
|
|
myObject = new myClass();
But you have assigned myObject to an instance...
|
|
|
|
|
Hi..
The exception only get thrown were you use the null reference, can you post the code, and give the line num that tthrows the exception.
Maybe we can see what you really trying to do.
.NET Rules
|
|
|
|
|
hi.
my error got rectified, that was because i had used transactions and missed out to assign the transaction property for the command object.
regards
-----------------------------------------------------------------
where there is a will there is a way
|
|
|
|
|
how to post my articles onto this forum?
|
|
|
|
|
You dont post articles to the forums. You submit them to CodeProject. Hover your mouse over the Articles menu, and select Submit an Article.
|
|
|
|
|
HI,
How can i programmatically restart SQL Server 2005 express edition? Any sample code,link, help etc.
Regards,
Wasif Ehsan.
|
|
|
|
|
Look at the ServiceController class in System.ServiceProcess.dll
|
|
|
|
|
Regex r = new Regex(@"[^t^\s^\d^x^X]|[^d^\s^\d^x^X]", RegexOptions.IgnoreCase|RegexOptions.Compiled);
what does this regular expression means
|
|
|
|
|
sarojkumarjena wrote: what does this regular expression means
I suspect an error, all those '^' are wrong (except the 1st 2 occuences). But here's the break down:
Match one character of ( (anything but t, ^, whitespace, number, x, X) or (anything but d, ^, whitespace, number, x, X) ).
See, its totally 'stupid'.
Do yourself a favour, and learn RegEx, much easier to write than to read IMO
|
|
|
|
|
int i=20;
How shall I show a value of i in message box
|
|
|
|
|
MessageBox.Show(i.ToString());
|
|
|
|
|
In order to show the value of i, you can use following:
MessageBox.Show(i.ToString());
Regards,
Wasif Ehsan.
|
|
|
|