Click here to Skip to main content
15,891,409 members
Home / Discussions / C#
   

C#

 
GeneralRe: Continuation of Correct way of doing installers Pin
glennPattonWork33-Jul-12 3:53
professionalglennPattonWork33-Jul-12 3:53 
GeneralRe: Continuation of Correct way of doing installers Pin
Pete O'Hanlon3-Jul-12 4:15
mvePete O'Hanlon3-Jul-12 4:15 
GeneralRe: Continuation of Correct way of doing installers Pin
glennPattonWork33-Jul-12 4:52
professionalglennPattonWork33-Jul-12 4:52 
GeneralRe: Continuation of Correct way of doing installers Pin
Pete O'Hanlon3-Jul-12 5:41
mvePete O'Hanlon3-Jul-12 5:41 
GeneralRe: Continuation of Correct way of doing installers Pin
glennPattonWork33-Jul-12 5:46
professionalglennPattonWork33-Jul-12 5:46 
GeneralRe: Continuation of Correct way of doing installers Pin
glennPattonWork33-Jul-12 5:59
professionalglennPattonWork33-Jul-12 5:59 
GeneralRe: Continuation of Correct way of doing installers Pin
glennPattonWork33-Jul-12 3:20
professionalglennPattonWork33-Jul-12 3:20 
QuestionText conversion Pin
Satay843-Jul-12 0:09
Satay843-Jul-12 0:09 
Hi All

I've got some problems with converting readed text from *.doc file. I'm using this code:

C#
FileStream fs = null;
 
fs = new FileStream(plik.ToString(), FileMode.Open);
byte[] example = new byte[fs.Length];
fs.Read(example, 0, example.Length);
string outtext = "";
int count = 0;
 
for (int i = 2560; i < example.Length; i++)
{
        if (example[i] == 0)
        {
                break;
        }
        count++;
}
 
BinaryReader br = new BinaryReader(fs, Encoding.GetEncoding(1250));
br.BaseStream.Position = 2560;  
byte[] newarr = br.ReadBytes(count); 
 
outtext = System.Text.UTF8Encoding.UTF8.GetString(newarr); 
string str = "";
for (int i = 0; i < outtext.Length; i++)
{
        if ((outtext[i] >= '!' && outtext[i] <= '~') || (outtext[i] == ' ') || (outtext[i] == '\r'))
        {
                str += outtext[i];
        }
}
fs.Close();
tekst = str;


It works great till I try to read file with polish symbols (ISO-8859-2). I try'ed to convert it to ISO-8859-2 but it is not working propertly.

Could anybody help me with this problem?
AnswerRe: Text conversion Pin
Eddy Vluggen3-Jul-12 0:51
professionalEddy Vluggen3-Jul-12 0:51 
GeneralRe: Text conversion Pin
Satay843-Jul-12 19:36
Satay843-Jul-12 19:36 
AnswerRe: Text conversion Pin
Eddy Vluggen4-Jul-12 1:03
professionalEddy Vluggen4-Jul-12 1:03 
GeneralRe: Text conversion Pin
Satay844-Jul-12 2:05
Satay844-Jul-12 2:05 
AnswerRe: Text conversion Pin
Eddy Vluggen4-Jul-12 2:15
professionalEddy Vluggen4-Jul-12 2:15 
GeneralRe: Text conversion Pin
Satay844-Jul-12 2:45
Satay844-Jul-12 2:45 
AnswerRe: Text conversion Pin
Eddy Vluggen4-Jul-12 3:05
professionalEddy Vluggen4-Jul-12 3:05 
GeneralRe: Text conversion Pin
Satay844-Jul-12 3:21
Satay844-Jul-12 3:21 
GeneralRe: Text conversion Pin
Eddy Vluggen4-Jul-12 3:27
professionalEddy Vluggen4-Jul-12 3:27 
Questionhow to get a ressource folder into the in folder Pin
baranils3-Jul-12 0:02
baranils3-Jul-12 0:02 
AnswerRe: how to get a ressource folder into the in folder Pin
Eddy Vluggen3-Jul-12 0:52
professionalEddy Vluggen3-Jul-12 0:52 
GeneralRe: how to get a ressource folder into the in folder Pin
baranils3-Jul-12 1:04
baranils3-Jul-12 1:04 
AnswerRe: how to get a ressource folder into the in folder Pin
Luc Pattyn3-Jul-12 0:58
sitebuilderLuc Pattyn3-Jul-12 0:58 
QuestionFacebook ads application Pin
twotwins2-Jul-12 22:21
twotwins2-Jul-12 22:21 
AnswerRe: Facebook ads application Pin
Eddy Vluggen3-Jul-12 0:54
professionalEddy Vluggen3-Jul-12 0:54 
GeneralRe: Facebook ads application Pin
twotwins3-Jul-12 2:28
twotwins3-Jul-12 2:28 
AnswerRe: Facebook ads application Pin
Eddy Vluggen3-Jul-12 2:44
professionalEddy Vluggen3-Jul-12 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.