|
Your mistake is wuite clear. First you changed the string to bytes using the IBM870 encoding. Then you changed that bytes to a string again using the Latin2 encoding. Here is the problem.
After that when you used the UTF8 encoding to convert the bytes to string, for sure it'll screw up.
What are you tying to do anyway converting strings to bytes back and forth?
Regards
|
|
|
|
|
Continue in the same thread instead of starting a new one.
---
Year happy = new Year(2007);
|
|
|
|
|
|
If I find that I have made a mistake in a posted message how can I remove it.
|
|
|
|
|
After opening your message, click Remove to delete it or modify to update it. (on the right bottom of the message)
|
|
|
|
|
I want to write a list of all the MP3's on a drive. In this form it finds 16940 files
void DirSearch(string sDir)
{
//FileInfo t = new FileInfo(Environment.CurrentDirectory + "\\all.lst");
//StreamWriter Tex = t.CreateText();
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d, "*.mp3"))
{
listBox1.Items.Add(f); // All files are found
//Tex.WriteLine(f);
}
DirSearch(d);
}
}
catch (System.Exception excpt)
{
Console.WriteLine(excpt.Message);
}
//Tex.Close();
}
When I switch to this form it only finds 590 files
void DirSearch(string sDir)
{
FileInfo t = new FileInfo(Environment.CurrentDirectory + "\\all.lst");
StreamWriter Tex = t.CreateText();
try
{
foreach (string d in Directory.GetDirectories(sDir))
{
foreach (string f in Directory.GetFiles(d, "*.mp3"))
{
//listBox1.Items.Add(f);
Tex.WriteLine(f);
}
DirSearch(d);
}
}
catch (System.Exception excpt)
{
Console.WriteLine(excpt.Message);
}
Tex.Close();
}
|
|
|
|
|
FileInfo.CreateText Method
Creates a StreamWriter that writes a new text file.
Do you want to create a new text file on every call to DirSearch(d)?
|
|
|
|
|
Your right! Thats the problem. Tnx.
|
|
|
|
|
I've got a DataGridViewComboBoxColumn that I want to bind to a datasource. However, on load, I want the DataGridViewComboBoxColumn to display values in from the column of a table.
So I'm sort of looking at a double purpose DataGridViewComboBoxColumn: i.e When in Read mode it displays values from the tables Columns, and when in Edit mode it populates the DataGridViewComboBoxColumn with additional items.
I just cant figure out how to do this.
-- modified at 18:54 Monday 15th January, 2007
Live in fragments no longer. Only connect.
|
|
|
|
|
how can i convert string from latin2 to utf-8. its a big problem for me becouse i have deadline in monday ... please can you help me, im workink with c# in vs2005. thanks Ondrej
-----------------------------
Computer is my hell on earth
|
|
|
|
|
byte[] converted = Encoding.UTF8.GetBytes(Encoding.GetEncoding("latin2").GetString(theData));
---
Year happy = new Year(2007);
|
|
|
|
|
it returns to me only that ĂĂ@Ĺ•‡@˘—…““‰•‡@„‰ƒŁßœGŽśEUQŢT.
first what i doing is convert string to byte[]:
byte[] data = Encoding.GetEncoding("IBM870").GetBytes(text);
second step is your code ...
byte[] converted = Encoding.UTF8.GetBytes(Encoding.GetEncoding("latin2").GetString(data));
and now i need a string in utf ...
string newtext = Encoding.UTF8.GetString(converted);
what is wrong???
-----------------------------
Computer is my hell on earth
|
|
|
|
|
You take a string, encode it using one encoding and decode it using another, and you wonder why it's not working?
You have to decode the data using the same encoding as it was encoded with.
---
Year happy = new Year(2007);
|
|
|
|
|
How can I used VBSkinner in C#.Net.
tell me details of that.
|
|
|
|
|
1 - please use meaningful titles
2 - what is VBSkinner ?
If it's a VB.NET dll, you can just import and use it. If it's VB6, you can't use it unless it exposes itself via COM.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
HI ALL
PROBLEM DESCRIPTION:
I AM OPEN WINDOW (DIALOGE BOX) USING JAVASCRIPT, PROMPT TO USER TO ANSWER QUESTION THEN ACCORDING TO ANSWERS I WANT CALL C# FUNCTION FROM CLIEN-SIDE.
HOW CAN I DO THAT PLEASE.
ALA QUNAIBI
ALA QUNAIBI
|
|
|
|
|
Please don't write in all capitals. On the web that is considered the equivalent of screaming.
What you are asking for is not possible. You can not call a server method from client code.
What you can do is to send a request to the server, and make the server code that handles the request call the C# method you want to call.
You can use AJAX to do the request to the server without having to reload the current web page.
---
Year happy = new Year(2007);
|
|
|
|
|
hi all,
why i can't find workflow project in C# menu. i'm using visual studio 2005
|
|
|
|
|
Do have VS2005 extensions for Windows WF installed?
|
|
|
|
|
i don't know. but i don't think that i installed it.
is it add-in or a separate componant
|
|
|
|
|
|
hi dear, i tried to install it but it refused to complete the setup
it give a log file i captured this form it
[6:54:45 PM Info] Detecting platform component: Windows XP Service Pack 2
[6:54:45 PM Info] The minimum required version is: 5.1.2600.2180
[6:54:45 PM Info] The currently installed version is: 5.1.2600.2180
[6:54:45 PM Info] Component already installed.
[6:54:45 PM Info] Detecting platform component: Microsoft .Net Framework 2.0
[6:54:45 PM Info] The minimum required version is: 2.0.00000.0
[6:54:45 PM Info] The currently installed version is: 2.0.50727
[6:54:45 PM Info] Component already installed.
[6:54:45 PM Info] Detecting platform component: Windows Workflow Foundation version 3.0.4203.2
[6:54:45 PM Info] Component is not installed.
[6:54:45 PM Info] No updates were found on the SUS server to download. === Logging stopped: 6:55:05 PM Sunday, January 14, 2007 ===
|
|
|
|
|
You need to install .Net 3.0 first
|
|
|
|
|
i am using vista ultimate+vstudio 2005 team+installed wf - but i cant find WF on visual studio. where hiding WF?
thx for help
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Athlon 64 3500+, Gigabyte GA-K8NXP-9, 2x512 DDR400 Kingston, Inno3d 6200 PCIe, SS2 B2C2 v2.6, HDD := 450gb, Genius 56k int, NEC DVD-RW и мать его Суньмастер 550.
|
|
|
|
|
Hi all ... I have different images which i would like to use as buttons. Is there any possible way that the png shape would map exactly on the button like for a circular image the button would also become circular not a rectangle..
Is there a possible solution to the problem or should i stick to use pictureboxes and assign events.
Thx
Bye
|
|
|
|