Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] Reading from xls files

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Mon Jul 13, 2009 4:06 am    Post subject: [C#] Reading from xls files Reply with quote

Hi there.
i'm trying to read data from excel file
so i tried the usual way
Code:

StreamReader sr = new StreamReader("fileName.xls");
MessageBox.Show(sr.ReadToEnd());

now when messagebox pops up all i can see is squares [][][][] or something like that
how can i read it properly?
Back to top
View user's profile Send private message
DanielG
Expert Cheater
Reputation: 1

Joined: 13 May 2009
Posts: 130
Location: The Netherlands

PostPosted: Mon Jul 13, 2009 4:27 am    Post subject: Reply with quote

Xls are binary files, so you can't just use streamreader and expect plaintext (.cvs files would work though).
You will need something that can read excel files.


for example: http://msdn.microsoft.com/en-us/library/ms173186%28VS.80%29.aspx
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Mon Jul 13, 2009 4:48 am    Post subject: Reply with quote

i looked at the but i couldn't understand something
how does the program should know where my excel file located?
i don't see any file path or something like that
Back to top
View user's profile Send private message
DanielG
Expert Cheater
Reputation: 1

Joined: 13 May 2009
Posts: 130
Location: The Netherlands

PostPosted: Mon Jul 13, 2009 5:09 am    Post subject: Reply with quote

Well it isn't a copy paste example, it just shows you what you can use in combination with excel files.

You should be able to find some examples based on common keywords in that article.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites