I agree with you, although my concern is if i put any code to check the int connection within the loop, performance is very poor. For example
Initialise and setup httpwebrequest/response
Do
Copy File
....
....
Create log
......
........
Loop until FileToCopyBytes =0
Copy File complete
Now...
I have a loop which performs some operations. Ive noticed if the internet connection is broken the loop continues but the operation fails.
The entire code is based on HttpRequest and Response.
What i would like is a way to trap if a valid connection is not available INSIDE the loop without...
I returned the headers for the HttpWebRequest, which came back with Authorisation: Basic XXXXXX and Host: download.site.com. So
1. Is this performing the same check?
2. If the answer to question 1 is yes then to me it seems the server doesnt support it.
If the server doesnt support resuming...
Thanks JohnH. I could do that but before i continue with this project i would like to see if i could test this before writing further code, as if the server doesnt support it i may just stop there?
Using a HTTPWebRequest with a Stream i can download files. What do i need to know if resuming downloads from where they were interrupted is supported?
Code wise i need to use AddRange and have that configured, however what is the priority order, i.e. If the server does not support resuming...
I now have the code but it doesnt seem to download the entire file, only a few bytes. If i change the buffer value it downloads according to it?
Thanks
Yes.... that led me to the link Simple web File download in VB.NET and gave me the impression to use FileStream, although after your reply i then was under the impression im on the wrong lines?
My reason for asking if i should use FileStream was in case there was another way to do the same task.
I am using a HTTPWebRequest to check for a file. Originally if a file was found i took action i.e. sent an email. Now i would like it so if the file is found it downloads it.
After reading some threads im a little confused with the approach i should take.
1. Should i use a fileStream to...
I wonder what's everyones opinion on this article - its lengthy but in short it seems Microsoft are heading towards dumping WPF, silverlight in favour for HTML5, Javascript when Windows 8 is released. Whether this is an over reaction by individuals or not im not so sure.
Why Microsoft has made...
My code to date is
Dim webRequest As System.Net.HttpWebRequest
Dim webResponse As System.Net.HttpWebResponse
SendPostRequesttoGoogle("https://www.google.com/accounts/ClientLogin") ' This includes the post data...
If System.Net.HttpStatusCode.OK Then
responseEncoding = System.Text.Encoding.UTF8
responseStream = HttpWResponse.GetResponseStream()
responseReader = New StreamReader(responseStream, responseEncoding)...
Thanks for your explanation. Perhaps ive not fully understood this :-(
I created another TA similar to
Select col1,col2,col3
From
Table
Now i create another query under the same TA which is
Select col1, col3
From
Table
(Thats no col2). But the same warning occurs - however im under the...
I add a new dataset to my ASP .Net project. I create a TableAdapter with one query:
Select col1, col2, col3 From MyTable
I then create a second query:
Select col1 WHERE col1=@Col1 From MyTable. I then get a warning
"the new command text returns data with schema different from the schema of...
I have some code that uses a WebRequest/Response. Since i need to check the thread is the same then perform the correct action i have to write code similar to (on the main application)
If <control>.Dispatcher.CheckAccess Then
DoSomething()
Else...
I have an application that i cant figure why im receiving the error:
System.UnauthorizedAccessException was unhandled
Message=Invalid cross-thread access.
It seems the error kicks in when i try to load the items in the textbox, although if the code to load the items is elsewhere i receive a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.