473,772 Members | 3,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application to download files using BITS from remote serve

I am working on an BIT application to download files from remote server using
C#, There are an issue related with performance, I am downloading 3 files
28Kb, 79KB, 121KB respectivly on my system(Pentium 4, RAM 512MB, DSL
connection) it is taking 15 to 25 seconds and shows 55-56 mx CPU usage but
other system with same configuration and T1 Line its taking so much time, it
is downloading these 3 files in hours and shows 100% CPU usage regularly, i
am not able to find out any solution, i have tried setting in Group Policy
and advance setting but this issue did not resolve.

could you please let me know the solution for it.
I am using following method to download those three files.

public void DownLoadFile(st ring GhostPath, string WebURL)
{
char ch='/';
try
{
Manager myBits = new Manager();
Job myJob = myBits.CreateJo b( WebURL.Substrin g(WebURL.LastIn dexOf(ch)+1 ));
myJob.AddFile(G hostPath,WebURL );
myJob.ResumeJob ();

do
{
if(myJob.State == JobState.Connec ting)
{
if(myJob.State == JobState.Transf erring)
{
do
{
Resume(myJob);
}while( myJob.State==Jo bState.Transfer ring);
}
}
else if(myJob.State ==JobState.Tran sferring)
{
do
{
Resume(myJob);
}while( myJob.State==Jo bState.Transfer ring);

if(myJob.State= =JobState.Trans ferred)
{
myJob.Complete( );
Cursor.Current = Cursors.WaitCur sor;
}
}
else if(myJob.State ==JobState.Susp ended)
{
do
{
Resume(myJob);
}
while( myJob.State==Jo bState.Suspende d);
}
else if(myJob.State == JobState.Queued )
{
do
{
Resume(myJob);
}
while( myJob.State==Jo bState.Queued);
}
else if(myJob.State ==JobState.Tran sferred)
{
myJob.Complete( );
Cursor.Current = Cursors.WaitCur sor;
return;
}
else if(myJob.State == JobState.Acknow ledged)
{
return;
}
else if(myJob.State == JobState.Errors || myJob.State ==
JobState.Transi entError )
{
myJob.Cancel();
}
}while( myJob.State != JobState.Transf erred && myJob.State !=
JobState.Errors && myJob.State != JobState.Transi entError && myJob.State
!=JobState.Queu ed);
}
catch(Exception ex)
{
MessageBox.Show (ex.ToString()) ;
}
}
Oct 6 '05 #1
0 1758

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

Similar topics

17
2304
by: Kevin Goodsell | last post by:
Is there a place I can download the last public draft for C89? What about a draft for C95? What I really need is a list of all standard library functions, macros, types, etc. for a "keyword file", which is used for syntax highlighting. I want to create one for both major C standards, with the C89/90 version including the 1995 amendment. I already have n869 for C99. Thanks.
0
5004
by: Rhon Stewart via DotNetMonster.com | last post by:
Hi please visit this link : http://www.eggheadcafe.com/articles/pfc/selfupdater.asp I followed all the steps for listed on the link , when I execute the application it it gives me the following error on the log file: --- ApplicationUpdateManager.StartUpdater] : The Updater has started; the target application's name is 'SayHello'. Time started: 2005_03_01_14:33:21.
0
1708
by: Rhon Stewart via DotNetMonster.com | last post by:
Please visit the following link: http://www.eggheadcafe.com/articles/pfc/selfupdater.asp Here A complete code for using Application updater , I downloaded the code from the link. When I run the application I found this error in the log: --- : The Updater has started; the target application's name is 'SayHello'. Time started: 2005_03_03_16:47:14.
1
1284
by: shekhartgs | last post by:
Please tell me how to debug an ASP.NET web application residing on a remote server? Can you pls tell me point by point as I am a new bie to a lil extent. Also please alert me where errors might come in the process of remote debug. Thanks a ton, shekhar
0
312
by: Sachit | last post by:
I am working on an BIT application to download files from remote server using C#, There are an issue related with performance, I am downloading 3 files 28Kb, 79KB, 121KB respectivly on my system(Pentium 4, RAM 512MB, DSL connection) it is taking 15 to 25 seconds and shows 55-56 mx CPU usage but other system with same configuration and T1 Line its taking so much time, it is downloading these 3 files in hours and shows 100% CPU usage...
5
1587
by: sc48567189 | last post by:
Hello ! I need some help here. I google after the response but with no sucess. I need to download - randon size - parts of a file, not the whole file. Says: I have the zip file test.zip, it is 10 mega bytes long. But I don't want the 10 mega today. Today I want 5 mega bytes. Tomorrow I could want more 3 mega bytes of the file, but it is not sure, could be 4 mega bytes. I need to part the zip file in chunks at request. No CGI, no asp, no...
2
1273
by: DBC User | last post by:
Hi, I am looking for a 3rd party software that I can integrate with my app to do download files from the web. I saw some software they are all end user software, I don't see any development software to integrate with ..net Is there a such software available? Thanks.
6
2983
by: Senthil | last post by:
Hi All We are having a VB application on SQL. But we need to collect information from persons who will be offline to verify data and insert new data. Generally they will be entering the data in Excel spread sheets which can be uploaded to the database using the application after some validations. But rather than Excel I was looking at Infopath with Access as the database, to create validation rules and collect data offline that can be...
3
9741
by: axelman | last post by:
Hi guys, I'm using Classic ASP, IIS6, IE 7, FF 3 I've developed a vb script to downloand files hosted in my server (zip, doc, pdf, jpg, xls, et. etc.) it's very straight forward and there's a lot of information around the web, however when it comes to dowload files from a remote server (NOT hosted in my server) there is no information :-(, the idea is to have an Access DB that stores the full url...
0
9620
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
10261
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...
1
10038
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
8934
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
7460
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
6715
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();...
0
5354
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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

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.