473,503 Members | 1,656 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 1052
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.Create("http://digi-wiz.com/uploads/upload/Nouns/");
HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
StreamReader strm = new StreamReader(HttpWResp.GetResponseStream(), 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
6942
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...
0
1105
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...
12
2847
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...
0
1315
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...
1
1960
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...
1
2672
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:...
1
8169
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...
3
9557
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...
0
1229
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...
12
2880
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...
0
7202
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,...
0
7084
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...
0
7278
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
7458
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...
0
5578
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,...
0
4672
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...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
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 ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.