473,383 Members | 1,739 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,383 software developers and data experts.

Reading A Text File From A Remote Server

I posted this message last week but seem to be missing a few days posts.

We currently run our web site in php and are now converting it to asp.net to
match the rest of our business that is .net based. I have tried using the
following code layout to open the file I require but get an illigal
character exception when I try and open the file.

Dim sFileName As String =
"https://www.breathecall.com/wholesale/api/api.php?partnerid=9aa999aa99999999aa99aaaa99a9a9aa &wid=99990&action=0&account=99999"
Dim oFileStream As New IO.FileStream(sFileName, IO.FileMode.Open)
Dim oDataFile As New IO.StreamReader(oFileStream)

The file name works fine when in php. Are there specific characters that
cannot be used in a path name within the dotnet framework? If so is there a
way to get round the problem?

Thanks in advance
Nov 19 '05 #1
1 3283
Hi Trevor,

Yes, I did have found your former thread in the newsgroup and replied in
that one, since you've missed that one, here is the google link of it:

http://groups-beta.google.com/group/...amework.aspnet
/browse_thread/thread/d74c2dbfc1b1a126/d2dc11ef1d402fd0?q=%22Reading+A+Text+
File+From+A+Remote+Server%22&rnum=2&hl=en#d2dc11ef 1d402fd0

Also, for your convenience, I've repasted my former response here, if there
are still anything unclear or need help, please feel free to post here.

=========================
Welcome to ASPNET newsgroup.
As for the Reading text file from remote server problem you mentiond, here
are some of my understanding and suggestinos:
The System.IO namespace's classes are target for local file storage for
remote fileshared (UNC) in the same intranet. For internet based
scenario(such as http url path), we should use the classes under System.Net
namespace to retrieve them. The System.Net.HttpWebRequest and
System.Web.WebClient classes are two useful one. And the WebClient is
especically useful and simplified, we can use it's DownloadData,
DownLoadFile to retreive file/stream from remote webserver. Here are some
tech articles and resources describing using webclient or webrequest:
#WebClient Class #HttpWebRequest Class
http://msdn.microsoft.com/libr-ary/e...syst-emnetwebc...
http://msdn.microsoft.com/libr-ary/e...Syst-emNetHttp...
#Using WebRequest and WebResponse classes
http://www.c-sharpcorner.com/I-ntern...sponseMDB-.asp
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
===========================================

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #2

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

Similar topics

4
by: JoelWhitehouse | last post by:
Hi! I want to write a script that will read a .php file on a remote server and print to the current page a portion of the text contained in the remote file. I am just wondering what the best...
1
by: Paul Fi | last post by:
I have this problem with .NET remoting: my remote class is called RemoteHandler which implements an interface called IEazyRemoting which has only one method to be implemented which is my server...
1
by: Trevor | last post by:
We currently run our web site in php and are now converting it to asp.net to match the rest of our business that is .net based. I have tried using the following code layout to open the file I...
2
by: Adrian | last post by:
Hi I have some local pages (on PC harddisk) that act as a user interface and a set of JS files that controls it all. I now want to be able to access a remote web server to read a txt file and use...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
6
by: Jason | last post by:
I would like to build a windows app or service that would read a .txt file and than put the contents of that file in an email and send off the email. WOuld that be very difficult?...how could this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.