473,405 Members | 2,261 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,405 software developers and data experts.

Web Server Read/Write

Hello,

I am trying to Read and Write to a text file on a web server using Microsoft Visual Basic 2005 Express Edition.

So far I have managed to complete my testing with a local text file using the StreamReader Class. Is it possible to use this class when trying to read and write to a text file located on a server? If so, could you please provide some examples?

I have setup a free web host with www.ifastnet.com and have some connection settings, mostly for FTP and mySQL.

If this is not a feasible option, could anyone help me with a web connection to a mySQL database to send data from client?

I would appreciate any help anyone can provide.

Thanks in advance.

Ross
Nov 19 '07 #1
4 3182
On Nov 18, 7:27 pm, "Ross" <ross-coo...@hotmail.comwrote:
Hello,

I am trying to Read and Write to a text file on a web server using Microsoft Visual Basic 2005 Express Edition.

So far I have managed to complete my testing with a local text file using the StreamReader Class. Is it possible to use this class when trying to read and write to a text file located on a server? If so, could you please provide some examples?

I have setup a free web host withwww.ifastnet.comand have some connection settings, mostly for FTP and mySQL.

If this is not a feasible option, could anyone help me with a web connection to a mySQL database to send data from client?

I would appreciate any help anyone can provide.

Thanks in advance.

Ross
What do you mean "on a server"? Is this a separate server, or the host
web server, or a mapped network drive, or something else?

Thanks,

Seth Rowe
Nov 19 '07 #2
Sure assuming that your code runs on the server (i.e. you write on your own workstation but because you runs server side code and so it will work on the web server side ; a common error is rather to think it writes client side when this is just because in a testing environment the client and the server are the same machine).

IMHO it's always best to tell us what you tried and what doesn't work rather than asking for samples.

The code is really just the same. Most problems are :
- permission issue
- writing in the "default" directory which is meaningless for a web application. Make sure to use an absolute path name (Server.MapPath could help).

For example #1 is not related at all with the actual code so a sample wouldn't help anyway. So what if you try the class you tested on your local web server ?

---
Patrice

"Ross" <ro*********@hotmail.coma écrit dans le message de news: 9E**********************************@microsoft.com...
Hello,

I am trying to Read and Write to a text file on a web server using Microsoft Visual Basic 2005 Express Edition.

So far I have managed to complete my testing with a local text file using the StreamReader Class. Is it possible to use this class when trying to read and write to a text file located on a server? If so, could you please provide some examples?

I have setup a free web host with www.ifastnet.com and have some connection settings, mostly for FTP and mySQL.

If this is not a feasible option, could anyone help me with a web connection to a mySQL database to send data from client?

I would appreciate any help anyone can provide.

Thanks in advance.

Ross
Nov 19 '07 #3
Ah you meant from a Windows application ? (I missed the "Visual Basic" instead of "Visual Web Developer")

It doesn't work this way as you generally don't have direct access to the web server file system.

You could post your file data using System.Net.WebClient.Uploadfile to upload the content of the text file to the web server. Server side you have a web page that receives this file (through the request.Files) and does whatever you want using this content.

You could also use web services so that the web site sends datasets to your client application thjat can then work on them and resubmit changes to the web server (is this a client side application that should be able to work on MySQL data handled by a web site ???)...

--
Patrice
"Patrice" <http://www.chez.com/scribe/a écrit dans le message de news: Op**************@TK2MSFTNGP05.phx.gbl...
Sure assuming that your code runs on the server (i.e. you write on your own workstation but because you runs server side code and so it will work on the web server side ; a common error is rather to think it writes client side when this is just because in a testing environment the client and the server are the same machine).

IMHO it's always best to tell us what you tried and what doesn't work rather than asking for samples.

The code is really just the same. Most problems are :
- permission issue
- writing in the "default" directory which is meaningless for a web application. Make sure to use an absolute path name (Server.MapPath could help).

For example #1 is not related at all with the actual code so a sample wouldn't help anyway. So what if you try the class you tested on your local web server ?

---
Patrice

"Ross" <ro*********@hotmail.coma écrit dans le message de news: 9E**********************************@microsoft.com...
Hello,

I am trying to Read and Write to a text file on a web server using Microsoft Visual Basic 2005 Express Edition.

So far I have managed to complete my testing with a local text file using the StreamReader Class. Is it possible to use this class when trying to read and write to a text file located on a server? If so, could you please provide some examples?

I have setup a free web host with www.ifastnet.com and have some connection settings, mostly for FTP and mySQL.

If this is not a feasible option, could anyone help me with a web connection to a mySQL database to send data from client?

I would appreciate any help anyone can provide.

Thanks in advance.

Ross
Nov 19 '07 #4
Hi, and thanks for the quick responses guys. Much appreciated.

My apologies, I think I may not have explained what I was trying to accomplish well enough in the first instance. Having been completely dumbfounded prior to posting, didn't help my explanation.

Basically, I have a Windows Application that prompts a user to input data. I would like this data to be written(uploaded) to either a text file or mySQL database on a remote server (current host: www.ifastnet.com).
This would enable a separate part of the program (distributed to other users) to download everyone's datasets (previously uploaded data) and present it accordingly.

The problem that I think I face is that, I am not using a hosted Microsoft SQL Server anywhere (as it costs, and would like to try alternative methods before applying cash to my little project) and I'm trying to get round this by alternative means.

It would be nice to practice freely using either a text file or mySQL using a free webhost, but I am unsure as to how to go about this. But I suppose that I may have to turn to a hosted MSSQL Server to complete the project.

I hope this added explanation helps.

Thanks for you comments regarding the WebClient.Uploadfile, I'll give it a try and see how I get on. But I would appreciate any further insight you might have.

Thanks guys,

Ross

"Patrice" <http://www.chez.com/scribe/wrote in message news:Ot***************@TK2MSFTNGP03.phx.gbl...
Ah you meant from a Windows application ? (I missed the "Visual Basic" instead of "Visual Web Developer")

It doesn't work this way as you generally don't have direct access to the web server file system.

You could post your file data using System.Net.WebClient.Uploadfile to upload the content of the text file to the web server. Server side you have a web page that receives this file (through the request.Files) and does whatever you want using this content.

You could also use web services so that the web site sends datasets to your client application thjat can then work on them and resubmit changes to the web server (is this a client side application that should be able to work on MySQL data handled by a web site ???)...

--
Patrice
"Patrice" <http://www.chez.com/scribe/a écrit dans le message de news: Op**************@TK2MSFTNGP05.phx.gbl...
Sure assuming that your code runs on the server (i.e. you write on your own workstation but because you runs server side code and so it will work on the web server side ; a common error is rather to think it writes client side when this is just because in a testing environment the client and the server are the same machine).

IMHO it's always best to tell us what you tried and what doesn't work rather than asking for samples.

The code is really just the same. Most problems are :
- permission issue
- writing in the "default" directory which is meaningless for a web application. Make sure to use an absolute path name (Server.MapPath could help).

For example #1 is not related at all with the actual code so a sample wouldn't help anyway. So what if you try the class you tested on your local web server ?

---
Patrice

"Ross" <ro*********@hotmail.coma écrit dans le message de news: 9E**********************************@microsoft.com...
Hello,

I am trying to Read and Write to a text file on a web server using Microsoft Visual Basic 2005 Express Edition.

So far I have managed to complete my testing with a local text file using the StreamReader Class. Is it possible to use this class when trying to read and write to a text file located on a server? If so, could you please provide some examples?

I have setup a free web host with www.ifastnet.com and have some connection settings, mostly for FTP and mySQL.

If this is not a feasible option, could anyone help me with a web connection to a mySQL database to send data from client?

I would appreciate any help anyone can provide.

Thanks in advance.

Ross
Nov 19 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mick Turner | last post by:
I have connected to SQL Server database (server-side vbscript) and read some data from the tables. This works correctly. I now have the data in an array (server-side). I have to draw a...
7
by: Niyazi | last post by:
Hi, I developed an application and I am using SQL Server 2000 developer edition. I create my database and I have also created tbl_USER table. I have an ID, RealName, UserName, and UserPassword...
4
by: David Bartosik - MS MVP | last post by:
Can I (and how) run a javascript in the code behind on the server and then send the results of the script to the aspx page. Thereby rendering the content regardless of the clients javascript...
0
by: Harley | last post by:
Hello, I am just learning the tcp/ip functions etc under vb.net so please look over me if this is obviouse. I have been all over looking into any functions that I didn't totaly understand and...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
5
by: Paul | last post by:
I am trying to create a log of certain events on the website by writing them to a text file. The logging code is in an "included" file that is inserted into the pages that need to be monitored....
5
by: Yossarian | last post by:
I have a handheld running CE .NET 4.2 and I am using c# with framework 1.1 to develop a solution for syncing data that is on the handheld with the local pc. Our handheld cradles only support...
8
by: swell | last post by:
I would like to write a server with the low level API of python ( socket+select and/or socket+thread ) that allow me to register client and update them every X seconds ( could be the time, the...
19
by: dunleav1 | last post by:
I built a test job that loads data into the database. I get great performance with Oracle and I'm trying to tune Sql Server to get the same type of performance. Based on system monitoring it...
3
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
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,...

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.