|
|
the question is how I can do all of the things what I want to do. Like during I am transferring the files on the local disk, I want the progress bar to be shown, instead of not showing anything, plus how many files I am transferring, which one is transferred at the moment like 2/4, and the estimated time the transfer will finish.
|
|
|
|
|
Well, you're going to need two progress bars - one to show the percentage of files you've transferred, and one to show the progress of the currently transferring file.
I would use a BackgroundWorker thread to manage the first progress bar, and that fires off an asynchronous ftp transfer (which would update the 2nd progress bar).
It's completely pointless (not to mention, redundant) to have a progress bar that shows the percentage of files remaining, and it's pretty much impossible to determine how long the whole transfer is going to take unless you time the transfer of each file and calculate an average while everything is transferring.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: It's completely pointless (not to mention, redundant) to have a progress bar that shows the percentage of files remaining, and it's pretty much impossible to determine how long the whole transfer is going to take unless you time the transfer of each file and calculate an average while everything is transferring.
Yeah but sometimes the client likes a bit of glitter on their turd app.
Add up the files, after the first one has finished guess that all the files will take that long and adjust your percentages appropriately; when the second has finished use the average and so on.
For extra points you could also display the name of each file as it is uploaded.
"If you reward everyone, there will not be enough to go around, so you offer a reward to one in order to encourage everyone."
Mei Yaochen in the 'Doing Battle' section of Sun Tzu's: Art of War.
.
|
|
|
|
|
He's not looking for points. He's looking for a solution.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I have one web page, know i want to run my windows application when i click on image Button.
|
|
|
|
|
what is the purpose ? does all client contin that exe file or what ??
|
|
|
|
|
Yes, All client will have this .exe on particular path.
|
|
|
|
|
Web apps cannot run local applications - its called security!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Actually i have my windows application on my machine. Know i want to run the windows application from image button click of my web page.
I am using System.Diagonistic.Process.start("exe path of windows application which is on my machine");
It is working fine, If i am creating new project and calling it on Image button click but when i am trying to use it in my existing project it is throughing exception "System.InvalidOperationException". I am doing work on C#.net.
Please Help me.
|
|
|
|
|
Dear experts,
I have the following problem.
I want to merge 2 xml-files into one automatically.
How can this be accomplished in the best way.
a) by a c#-pgrogram
b) by xslt-transformation
c)...
do you have any link/solution?
Kind regards
|
|
|
|
|
guess it depends on how the merge should work.
if you only need to append one file to another, cmd.exe will do the job.
xslt is fine, but you'll need something that starts the transformation process automatically.
|
|
|
|
|
hi
i want to know about my old file_size and new file_size to read its difference with the lest overhead
do anyone know any good way ?
Is there a way to get old size of file via FileSystemWatcher ?
|
|
|
|
|
Use the Systemm.IO.FileInfo class.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
I have a dictionary of items. I want to create a new Dictionary by taking items from it where each item meets a particular criterion. I figure that the ToDictionary extension method would suit my purpose, but for the life of me I cannot get it to compile.
<pre>
Dictionary<int, string> test = new Dictionary<int, string>{
{1 ,"a"},{2, "b"},{3 ,"c"},{4, "d"}
};
Dictionary<int, string> d = test.ToDictionary<int, string>(o => o.Value.CompareTo("d") == -1);
// compiler error on this line
//'System.Collections.Generic.Dictionary<int,string>' does not contain a definition for 'ToDictionary' and the best extension method overload //'System.Linq.Enumerable.ToDictionary<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,TKey>)' has some //invalid arguments
</pre>
The only thing that I could manage that came close to what I need is:
<pre>
List<KeyValuePair<int, string>> t1 = test
.Where(o => o.Value.CompareTo("d") == -1)
.ToList<KeyValuePair<int, string>>();
</pre>
I reckon I'm doing something really stupid but I can't see what it is. Can anyone help me out?
Thanks very much,
dlarkin77
|
|
|
|
|
This will work for you:
IDictionary<int,string> d = (
from t in test
where t.Value.CompareTo("d") == -1
select t).
ToDictionary(item => item.Key, item => item.Value);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That works lovely. Thank very much.
|
|
|
|
|
I want to transfer the data from excelsheet to data table,one by one entry
can any one help me to do so or send code for that in c#
|
|
|
|
|
abhijitjathar wrote: I want to transfer the data from excelsheet to data table
Does it mean you want to read excel sheet and display data in your App or you want to export the data to some other destintaion?
abhijitjathar wrote: one by one entry
What do you mean by this?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You can simply use ODBC to read data from excel to datatable.
|
|
|
|
|
Hi all.
Is exists way to binding cutsom type value to Control through databinding
Example
public class CLASSIFIED
{
public CLASSIFIED(double Val)
{
this._value = Val;
}
private double _value;
public static implicit operator CLASSIFIED(double Val)
{
return new CLASSIFIED(Val);
}
public static implicit operator double(CLASSIFIED CLASSIFIED)
{
return CLASSIFIED._value;
}
}
class SourceProvider
{
CLASSIFIED Index {get{...} set{...}}
}
...
control.DataBindings.Add("EditValue", _sourceProvider, "Index");
...
I know what i can do it through IFormatProvider interface like what : control.DataBindings.Add("EditValue", _sourceProvider, "Index", null, null, _myFormatProvider);
But what about other way, derive my custom type from AN INTERFACE what DataBindings.Add(...) recognize and format my custom type value automaticaly????
<br />
public class CLASSIFIED : ISomeInterfceWhatDataBindingRecoginze<br />
{<br />
....<br />
}<br />
}<br />
THANK!!!
|
|
|
|
|
This[^] might be a good place to start looking.
El'Cachubrey wrote: derive my custom type from AN INTERFACE
IDatatSource[^] perhaps?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
How do I initiate a queue of paired values?
|
|
|
|
|
Dictionary dictionary = new Dictionary();
or
KeyValuePair<string,string> myKVP = new KeyValuePair<string,string>();
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Friday, September 5, 2008 11:31 AM
|
|
|
|
|
Did you try Queue<KeyValuePair<string, string>> ?
|
|
|
|