473,659 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?partner id=9aa999aa9999 9999aa99aaaa99a 9a9aa&wid=99990 &action=0&accou nt=99999"
Dim oFileStream As New IO.FileStream(s FileName, IO.FileMode.Ope n)
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 3316
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/d74c2dbfc1b1a12 6/d2dc11ef1d402fd 0?q=%22Reading+ A+Text+
File+From+A+Rem ote+Server%22&r num=2&hl=en#d2d c11ef1d402fd0

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.Http WebRequest and
System.Web.WebC lient 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
2293
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 method is for reading from a file in this case - the file is only a few bytes long. I've seen a tutorial or two that only tangentially addresses my problem, and even then each one has varied greatly as to which object they utilize. Any ideas to...
1
2851
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 configuration file looks like this: <configuration> <system.runtime.remoting> <application> <service>
1
538
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 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...
2
17389
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 the result in my local script. eg Remote text file i.e. conf.txt
9
3597
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 that its buffer is bigger than this. I did this expecting the data to be read in one pass.
4
2383
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 line. It also works when pulling the options from a file.
29
2998
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 switch/case to take action based on that value in the cookie. I want to set the cookie manually, so I don't need setcookie(). I see that in PHP it stores the cookie in memory. Is there a way to have PHP just read a cookie from the desktop machine?...
13
31385
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 outside of our domain, we get the error.. ** Client found response content type of 'text/html; charset=Windows-1252', but expected 'text/xml' **. We can discover the web service by typing in the url of the asmx so we know the server can 'see' it...
6
2211
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 be done?
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1976
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.