473,569 Members | 2,991 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

want to read the first line from a text file and show it into a msg box in c#

5 New Member
hi,
This is gaurav karode. i want a little code help.I am making an application in which i have to show a msg box and the content of msgbox will be from a text file. so basiclly i have to read the first line of text file and show it into a msg box. i tried different things but unable to do that. ican read from the text file but how to show it into a msg box.One more thing we can use msgbox.showin windows application but cant into a web application. i want the code so that i can perform this task.
Thanking You
gaurav karode
Jul 29 '10 #1
6 1995
ThatThatGuy
449 Recognized Expert Contributor
Have you tried it...
Then Post some code...
Jul 29 '10 #2
karodegaurav
5 New Member
hi,

i tried that and successfully shown the line into the msg box but the msg box value is coming from the textbox. i dont want to take the text box . i want the line directly into the msg box. maybe i am very near to it.i am sending my code. check it out i am attaching the code down

Thanks in advance
gaurav karode
Attached Files
File Type: txt code to read a file and put it into msgbox.txt (1.5 KB, 409 views)
Jul 29 '10 #3
MrMancunian
569 Recognized Expert Contributor
Did you write that code yourself or did you get it from some website? Try searching google for "streamread er c#", "open file c#" and "read from file c#".

Steven
Jul 29 '10 #4
Sfreak
64 New Member
I think he is trying to show a message (MessageBox.Sho w())from an asp.net application or another web language. In this case you must call a javascript function. here is an example of how to do it. http://www.savetosim.com/javascript/ch01.html

I hope it help you

[]´s
Jul 29 '10 #5
karodegaurav
5 New Member
@Sfreak
hi,
Thanks for replying. The link u sent to me also takes the data first into a text box but i dont want to show in the text box i want the data directly into the messagebox .please give it a time and try to figure it out
Thak you in advance
Jul 30 '10 #6
Sfreak
64 New Member
Well in this case, declare a public class attribute and pass this attribute to your function
onClick="MsgBox (MyClassAttribu te)">
Jul 31 '10 #7

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

Similar topics

3
11772
by: H Brown New To It | last post by:
I am very new to Java. How would you go about making Java program that reads in a fixed length text file and pass the data into a table in an sql table? The text file data looks something like this: 123456John Smith Acme Boxes Inc 100 Someplace Drive 222222Sarah E. ConnorCyberdyne Systems Corp 1 Connorsbane Plaza...
4
2587
by: Dave | last post by:
Hello all, The scheme shown below to move a text file's contents into a std::string works with one exception: it drops the carriage return and line feed characters. How may I, in a Standard-compliant way, read in a text file's contents and keep the carriage returns and line feeds? Thanks, Dave
4
5187
by: Paul | last post by:
Hello Everybody, Being new to VBA for Access, I have a question about inputing a text file into access. The text file has 23 lines per file and needs to go into 1 record in a table. The 1st four lines are garbage and don't need to be inputted. THe rest of the lines only need what is after an equal sign (=) inputted. Can somebody please...
13
6098
by: Dan V. | last post by:
How do I create a one line text file with these control codes? e.g.: 144 = 0x90 and 147 = 0x93? I am trying to create a one line text file with these characters all one one row with no spaces. 1. 144 = 0x90 2. 147 = 0x93 3. STX = (^B = 2 = 0x2) 4. NUL = (^@ = 0 = 0x0)
4
1411
by: Daniel Kaseman | last post by:
I want to make a program that has 3 textboxes for inputting: Name, ID, Amount, and then when I click "Add Item" button, it adds it to a text file, and shows up on the list box. When I close and reopen the program, the text file should fill the listbox with the records. How do I do this? Is this a "Sequential Access file" ? thanks
3
1604
by: Jason | last post by:
Can someoneillustrate how I would open a text file that looks something similar to this: namea,8888,1234.99 nameb,8887,1242.50 and then after opening that file read each one of the values into an array...namea and 8888 and 1234.99 would be three arrays thanks
8
2123
by: MLH | last post by:
Am trying to import 20,000+ lines of text in a file FTP'd from a UNIX platform to windows via FTP session in a DOS box. About 2000 records have multiple lines in them separated by CRLF's. That's not the idea. Each line was supposed to be a separate record. I don't know why the 2000 records having MULTIPLE lines of text are so stubborn....
1
3211
by: Saravanan | last post by:
I need to read in a text file as strings and then write some of these strings into another text file. The output file is in the working directory while the input text file is not. how can I implement... saran
9
4303
by: mabond | last post by:
Hi My text file varies in size on each occasion it is processed (i.e different number of lines) Contents are coma separated, giving data for each column in my sql table (number of columns is constant) My problem is not knowing how many lines are in my file. I want to use this
6
14541
by: arf | last post by:
Hello, i have a problem where i need read dataset from text file and keep them into a vector. e.g. dataset: "0012 0033 00045 0044 0047" Based on this dataset, i need to keep every 4 numbers separately into a vector.
0
7618
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7679
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.