473,388 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to retrieve data from file(notepad) using c# in client side

Platform : Visual Studio 2005
Language : Visual C#
We need code to retrieve data from notepad in client side for WebApplication
Jun 20 '07 #1
6 5739
Do you want to open a text file and read it?
Jun 20 '07 #2
tal170
7
you have to add using System.IO at the top
and then you open the text file using the StreamReader object


example

string mytext;
StreamReader read = new StreamReader("1.txt");
mytext = read.ReadLine();
Jun 23 '07 #3
Yes I have to read file.
Jun 29 '07 #4
nmsreddi
366 256MB
Hello

What do you mean reading textfile at client side ,

you want to readfiles that client uploaded using your application .where the file that you want to read resides ,do you know thepath of that file,

please send some details so that you can get goodresponse
Jun 29 '07 #5
use the stream reader in reading data from textfile
this is a c# code,if you are using vb.net,just try to understand and convert this code to vb.net...


using system.io;

streamreader read= file.opentext("sample.txt");
string input=null;
whiel((input=read.readline)!=null)
{
richtextbox.appendtext(input);
}
read.close();

this code can read multi line data in the text file


enjoy coding,hope this can help you
Jun 29 '07 #6
This is your C# code in the form of VB.
My problem is , It not return multiple line from text file.
Because, In Vb , How Can I compare NULL in while Condition ?
Reply your response to <Removed> also...

VB.NET
Dim input As String = ""
Dim read As StreamReader
read = File.OpenText("textfile.txt")
While ((input = read.ReadLine) <> False)
RichTextBox1.AppendText(input)
End While
read.Close()




use the stream reader in reading data from textfile
this is a c# code,if you are using vb.net,just try to understand and convert this code to vb.net...


using system.io;

streamreader read= file.opentext("sample.txt");
string input=null;
whiel((input=read.readline)!=null)
{
richtextbox.appendtext(input);
}
read.close();

this code can read multi line data in the text file


enjoy coding,hope this can help you
Jul 3 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Gary Quiring | last post by:
I have a vendor sending me a text file using POST. I have a PHP program receiving the data that works. I need to in the same stream return an answer via POST. How do I send that POST in the same...
0
by: suresh | last post by:
hi, how do we define the custom data using solutionXML tag in Visio XML file. I have opened the already existing XML file and defined the data as the code given below. <SolutionXML...
1
by: mark.heyden | last post by:
Hi Frends, I am facing problems while trying to export data into pipe format. In fact I am fetching records from mysql database and then trying to create a text file ( using pipe as delimeter) ,...
2
by: Praveen_db2 | last post by:
Hi all Db2 8.1.3 windows Is there any way to write data into a text file using a stored procedure? The way we return a cursor output to the calling application, can we return data in a text...
1
by: intscript | last post by:
Hi everyone Is is possible to retrieve data using multiple select. Here is my SQL code: select sum(nPassengers) Planned, Actual, (sum(Planned) - Actual) Variance from ( select iDeptCode,...
0
by: mail | last post by:
Hi Is it possible to edit an asp file using filesystem? when I read a text file using filesystem it doesnt show me the asp code in the <% tags as this code is run server side, but is there a way...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
4
by: Pranjal9880 | last post by:
Hi all I am trying to parse the xml file using perl in which I am succeeded , I am able to fetch the data from the xml file by using one keyword. Now I want to do it using more than one keyword. It...
5
harshadd
by: harshadd | last post by:
can some one explain me, how to update foxpro table (.dbf file) using clien side coading in DHTML or ay client side code like java?
1
by: Zuhaib Hyder | last post by:
how to delete client file using c# or javascript ? file delete prmissions are already given?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.