473,651 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebRequest not showing everything....

21 New Member
I am using this...
Expand|Select|Wrap|Line Numbers
  1. string url = "http://digi-wiz.com/uploads/upload/Nouns";
  2. string result = null;
  3.  
  4. WebClient client = new WebClient();
  5. result = client.DownloadString( url );
  6. MessageBox.Show(result);
  7.  
Which is very basic code. It just looks at the files in the http://digi-wiz.com/uploads/upload/Nouns

Now, if you actually go to that website and view source, or just look at it, it shows TWO files there.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <HTML>
  3.  <HEAD>
  4.   <TITLE>Index of /uploads/upload/Nouns</TITLE>
  5.  </HEAD>
  6.  <BODY>
  7. <H1>Index of /uploads/upload/Nouns</H1>
  8. <PRE><IMG SRC="/icons/blank.gif" ALT="     "> <A HREF="?N=D">Name</A>                    <A HREF="?M=A">Last modified</A>       <A HREF="?S=A">Size</A>  <A HREF="?D=A">Description</A>
  9. <HR>
  10. <IMG SRC="/icons/back.gif" ALT="[DIR]"> <A HREF="/uploads/upload/">Parent Directory</A>        23-Jan-2008 14:58      -  
  11. <IMG SRC="/icons/text.gif" ALT="[TXT]"> <A HREF="180%20Body%20Parts.lll">180 Body Parts.lll</A>      24-Jan-2008 19:36     4k  
  12. <IMG SRC="/icons/text.gif" ALT="[TXT]"> <A HREF="Schaums%20Outlines%20-%20Vocab%20-%20Chapter%201%20-%20Am%20Flughafen.lll">Schaums Outlines - V..&gt;</A> 22-Jan-2008 11:21     3k  
  13. </PRE><HR>
  14. <ADDRESS>Apache/1.3.37 Server at digi-wiz.com Port 80</ADDRESS>
  15. </BODY></HTML>
  16.  
The two files are...
180 Body Parts.lll
and then
Schaums Outlilines Vocab - Chapter 2 - Am Flughafen.lll


But if you run that code above it ONLY ever shows the Schaums outlines one. Why is that? It completely skips the line about the 180 Body Parts....Anyone know why and how to fix it?
Jan 25 '08 #1
4 1069
Plater
7,872 Recognized Expert Expert
Why are you using webclient and not HttpWebRequest ?
Jan 25 '08 #2
RobAMacAF
21 New Member
Why are you using webclient and not HttpWebRequest ?
When I searched google to figure out how to do this the first couple tutorials I read all used webclient. I will go look at HttpWebRequest and see what the difference is.
Jan 25 '08 #3
RobAMacAF
21 New Member
Why are you using webclient and not HttpWebRequest ?
Ok, I switched to HttpWebRequest and am having the same exact issue. If I pull up http://digi-wiz.com/uploads/upload/Nouns/ then it shows 3 files....but if I run this code..

HttpWebRequest HttpWReq = (HttpWebRequest )WebRequest.Cre ate("http://digi-wiz.com/uploads/upload/Nouns/");
HttpWebResponse HttpWResp = (HttpWebRespons e)HttpWReq.GetR esponse();
StreamReader strm = new StreamReader(Ht tpWResp.GetResp onseStream(), Encoding.ASCII) ;
string line;
while ((line = strm.ReadLine() ) != null)
{
MessageBox.Show (line);
}

Then it only shows 2 files (I uploaded a third which you can see if you put that address in your browser). I don't know why it won't ever show the other one.

Yesterday it was only showing the one....then a couple hours later I tried it again and it showed both. So this morning I uploaded one more, it shows it through IE (all 3 files) but using this code it is still showing 2!!! SO CONFUSING!!!
Jan 25 '08 #4
Plater
7,872 Recognized Expert Expert
I think it is something on your end.
I just ran your code and all the objects showed up just fine:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <HTML>
  3.  <HEAD>
  4.   <TITLE>Index of /uploads/upload/Nouns</TITLE>
  5.  </HEAD>
  6.  <BODY>
  7. <H1>Index of /uploads/upload/Nouns</H1>
  8. <PRE><IMG SRC="/icons/blank.gif" ALT="     "> <A HREF="?N=D">Name</A>                    <A HREF="?M=A">Last modified</A>       <A HREF="?S=A">Size</A>  <A HREF="?D=A">Description</A>
  9. <HR>
  10. <IMG SRC="/icons/back.gif" ALT="[DIR]"> <A HREF="/uploads/upload/">Parent Directory</A>        23-Jan-2008 14:58      -  
  11. <IMG SRC="/icons/text.gif" ALT="[TXT]"> <A HREF="180%20Body%20Parts.lll">180 Body Parts.lll</A>      24-Jan-2008 19:36     4k  
  12. <IMG SRC="/icons/text.gif" ALT="[TXT]"> <A HREF="Clothing%20-%20Bags%20-%20Jewelry.lll">Clothing - Bags - Je..&gt;</A> 25-Jan-2008 12:22     4k  
  13. <IMG SRC="/icons/text.gif" ALT="[TXT]"> <A HREF="Schaums%20Outlines%20-%20Vocab%20-%20Chapter%201%20-%20Am%20Flughafen.lll">Schaums Outlines - V..&gt;</A> 22-Jan-2008 11:21     3k  
  14. </PRE><HR>
  15. <ADDRESS>Apache/1.3.37 Server at digi-wiz.com Port 80</ADDRESS>
  16. </BODY></HTML>
  17.  
Jan 25 '08 #5

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

Similar topics

1
6959
by: Matthias Kwiedor | last post by:
I try to get a page from a https server. I can build up a connection with WebRequest and everything runs fine without setting a proxy. After setting a proxy, i get the error that i can't build a thrusted connection to the remote server. If i try it over the IE i get a pop up which tells me the same, but i can override it! Anyone has i idea? i need that in combination with a cookiecontainer! Code:
0
1117
by: Jeff | last post by:
I am using System.Net.WebRequest to request an aspx from another aspx. If the remote requested page is accessed using a url in the form http://localhost everything works fine. However if the request is made using http://<machinename> I get an internal server error. The requests are made to the same machine and same page. Ultimately the second page will be on a remote server, but for development/debug purposes it's currently on the same...
12
2857
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts the query string with no url encoding. I must pass the <> characters as they are in the query string. If these characters are url encoded the service rejects the request. This API Url is http://testing.shippingapis.com/ShippingAPITest.dll
0
1320
by: Tony Archer | last post by:
Here's my problem... When I use this code to hit the site in question I'm redirected to another SSL login page. If processed successfully the page creates a cookie and then redirects you to the original request. However, my code cannot seem to hold onto the cookie it creates. Does anyone know how to do this?
1
1967
by: KReichert | last post by:
How do you retrieve the streaming 'parts' of a multipart message from a WebRequest? Here is the situation. A WebRequest is submitted to a server (http://TheServer:80/GetMedia?ID=1). This causes the server to push/stream a multipart message back to the client in the following format: HTTP/1.1 200 OK
1
2681
by: Christian Urbanczyk | last post by:
Hello! I have a problem with the Webrequest. I've search everywhere to find an answer but it seems that no one has the the problem before. So i hope somebody can help me here! Following Code: _________________________________________ WebRequest wrq = WebRequest.Create(URL); WebResponse wrs = wrq.GetResponse();
1
8185
by: Mr Flibble | last post by:
OK I logon to a web site and I manage to get an SMSESSION cookie that I then store in a variable called _session (a class scoping variable). I do this by calling a logon URL and setting a cookie to SMCHALLANGE=YES to allow me to obtain a session. I then iterate the cookie collection to extract the SMSESSION value. All is good (so far). This is when the sky turns grey and the rain starts to fall. I then use this SMSESSION in a web...
3
9578
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm trying to create a call to a web page to validate and register software. The code I'm using is: Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim WebRequest As HttpWebRequest Dim instance As HttpWebRequest =...
0
1247
by: Petri | last post by:
Hi, I'm porting my App from .NET 1.1 to .NET 2.0, and I encountered a really weird problem. I hope some of you could help... I have a function that downloads an XML file from a web server to check version information etc. It has not been touched in anyway. Up until now I had the whole app as a single EXE, I now started to split it into EXE and DLL that would contain shared classes and functions (I'm
12
2901
by: Mads Aggerholm | last post by:
Hello Sirs I hope you can give me a hint to this little problem. The thing is, I have for a lang time enjoyed the comics on www.washintonpost.com, and I allways start the day by going to their homepage. One day, I thought: Why not just make a little program in C#, that just shows me the .gif-picture of the strip? And so I did. Or, more correctly, I tried to do.
0
8275
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
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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...
0
8576
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
7296
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
6157
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
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
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.