| | |
reading a text file to a remote PC
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 66
Reputation:
Solved Threads: 0
hello everyone!
Anyone has an idea of reading the content of the text file from the remote computer using ASP.Net VB.
I know how to read textfile if it resides in the server but i keep searching on the net on how I can read the data from the textfile but up to now I can't find. Location is fixed, example: C:/Directory/Textfile.txt.
That is the location where I am going to pull the data inside the textfile then after reading it will delete the textfile generated.
Anyone has an idea please help. Thanks a lot.
Regards
Anyone has an idea of reading the content of the text file from the remote computer using ASP.Net VB.
I know how to read textfile if it resides in the server but i keep searching on the net on how I can read the data from the textfile but up to now I can't find. Location is fixed, example: C:/Directory/Textfile.txt.
That is the location where I am going to pull the data inside the textfile then after reading it will delete the textfile generated.
Anyone has an idea please help. Thanks a lot.
Regards
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
if you have a network access to remote computer, you do the same thing while reading the text file. instead of local file representation, you are going to use network file representation of the location to that file like this:
\\servername-or server ip\\path\filename.txt. it is as easy as it is to read from local server file.
\\servername-or server ip\\path\filename.txt. it is as easy as it is to read from local server file.
Due to lack of freedom of speech, i no longer post on this website.
•
•
Join Date: May 2007
Posts: 66
Reputation:
Solved Threads: 0
HI! Im sorry but what I am referrring is, they are using internet to register someone's profile and one part of it is to pick up the file from that PC. File is not reside in the server and it is located in any PC that has an access to the the web pages. It is in the client PC and not in the server. In order to get the file, there is button in the webpage to pick up the file then reads it content. Please help. I did readiang textfile but it rresides in the PC and not in the cleint PC. The location of the textfile is fixed as shown for example. C:\Directory\textfile.txt
Thanks
Thanks
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 118
ok i got your question now, you can do that with javascript i believe. i have tried that before and it worked, search google with javascript read file, you will find something useful. or you can create a windows app and have the users install it and then transfer the file using a webservice, or just basically have the user upload the file using fileupload webcontrol.
Due to lack of freedom of speech, i no longer post on this website.
•
•
Join Date: Oct 2008
Posts: 8
Reputation:
Solved Threads: 1
it is very simple with asp net .
Put a File Upload Button in yours controls.
suppose there is a button on urs controlls READ.
on the event handler Read on click event use this Code.
suppose FileUpload button have the ID
File1.PostedFile.SaveAs(Server.MapPath(filename to save));
for reading a file
String strXMLFileContent = "";
using (StreamReader SR = new StreamReader(Server.MapPath(FIle Name on which you have saved)))
{
while (SR.EndOfStream == false)
{
strXMLFileContent += SR.ReadLine();
}
SR.Close();
}
to delete File
File.Delete(Server.MapPath(Filename to delete from Server);
Put a File Upload Button in yours controls.
suppose there is a button on urs controlls READ.
on the event handler Read on click event use this Code.
suppose FileUpload button have the ID
File1.PostedFile.SaveAs(Server.MapPath(filename to save));
for reading a file
String strXMLFileContent = "";
using (StreamReader SR = new StreamReader(Server.MapPath(FIle Name on which you have saved)))
{
while (SR.EndOfStream == false)
{
strXMLFileContent += SR.ReadLine();
}
SR.Close();
}
to delete File
File.Delete(Server.MapPath(Filename to delete from Server);
![]() |
Similar Threads
- SpeedUp Your Window XP Never Than Before (Windows tips 'n' tweaks)
- Confused with reading Microsoft White Papers and Instructions (ASP)
- Pls help! - Desktop/Taskbar disappear - 7 instances of svchost (Windows NT / 2000 / XP)
- Help me to develop Messenger Project (IT Professionals' Lounge)
- hello i need help please (PHP)
- Fake Microsoft Windows Security Warning (Viruses, Spyware and other Nasties)
Other Threads in the ASP.NET Forum
- Previous Thread: Transferring Variables
- Next Thread: How to store sent mails
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers






