Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my code in the p.h.p is file_get_contents
i want to understanding that equal code in c#????
Posted
Updated 18-Apr-23 2:48am

C#
TextReader tr = new StreamReader("DataFile.txt");
string text = tr.ReadToEnd();
tr.Close();
 
Share this answer
 
Comments
Sandeep Mewara 22-Mar-11 7:36am    
Comment from OP:
no - i want get all record content in the web pages for example :
all record in the n page of the website must be save my database or my file (. t x t ) ..
in the other word in the page1 100 record and page2 is 200 record ... and page n ...n record
i want get all record of the all page in the web page and save it to
myself database.
you can use

C#
string txt= File.ReadAlLines(path);


add reference to System.IO for this.

--Pankaj
 
Share this answer
 
Comments
Sandeep Mewara 22-Mar-11 7:36am    
Comment from OP:
no - i want get all record content in the web pages for example :
all record in the n page of the website must be save my database or my file (. t x t ) ..
in the other word in the page1 100 record and page2 is 200 record ... and page n ...n record
i want get all record of the all page in the web page and save it to
myself database.
In C# there are no commands. (I'm not quite sure this term is valid for PHP, probably not.) This is not interpreted languages, as everything in .NET. Compiler compiles everything in IL, and compilation to the machine codes is done by JIT (Just In Time) compiler during run-time call-by-call, i.e. on demand.

Before you go into detail, read general characteristics of each language you learn, as well as their relationships with other languages: http://en.wikipedia.org/wiki/C_Sharp_(programming_language)[^], http://en.wikipedia.org/wiki/PHP[^].

Try to avoid "translation" of what you know into new languages, it is very misleading. In first staged, try to "forget" what you know and dive into the world of different concepts.

—SA
 
Share this answer
 
Comments
Sandeep Mewara 22-Mar-11 7:36am    
Comment from OP:
no - i want get all record content in the web pages for example :
all record in the n page of the website must be save my database or my file (. t x t ) ..
in the other word in the page1 100 record and page2 is 200 record ... and page n ...n record
i want get all record of the all page in the web page and save it to
myself database.
Sergey Alexandrovich Kryukov 22-Mar-11 14:02pm    
What's "No"?! No matter what you want, my Answer is correct. Did you read it just threw out as "off-topic"? You won't move to far in this way...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900