469,269 Members | 1,006 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,269 developers. It's quick & easy.

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

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 1687
449 Expert 256MB
Have you tried it...
Then Post some code...
Jul 29 '10 #2

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, 352 views)
Jul 29 '10 #3
569 Expert 512MB
Did you write that code yourself or did you get it from some website? Try searching google for "streamreader c#", "open file c#" and "read from file c#".

Jul 29 '10 #4
I think he is trying to show a message (MessageBox.Show())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

Jul 29 '10 #5
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
Well in this case, declare a public class attribute and pass this attribute to your function
Jul 31 '10 #7

Post your reply

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

Similar topics

3 posts views Thread by H Brown New To It | last post: by
4 posts views Thread by Daniel Kaseman | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.