|
Raymond_P* wrote: Thhats what i ment , i want to fund a way of uploading the file overwriting the old one using FTP .
Raymond_P* wrote: i ment its ok for me to put my username and pass into the application i wont be handing it out to anyone .
In the future you might find it is more productive to put what you "mean" in your first post rather than making people drag information out of you. At this point I have lost interest in helping you.
|
|
|
|
|
Has anyone got a reliable multithreaded file copy program with progress display ? I love robocopy, but no c# wrapper is available and I can't track individual file progress.
thanks!
h.
|
|
|
|
|
hk11 wrote: Has anyone got a reliable multithreaded file copy program with progress display ?
Well it's been three hours since you posted, do you have that finished yet?
|
|
|
|
|
hk11 wrote: I can't track individual file progress.
Yes you can. Use a FileStream to read the bytes and a FileStream to write the bytes. Read and write pieces at a time to do your own progress of copying a file.
|
|
|
|
|
Hi I want to create a Listbox which Displays Text but instead of showing the white background I want the Background to be that of its Parent( its containing Form or Panel). So We have a Listbox displaying its contents as text but the background is the image which I've set for its Form.
Thanks...
|
|
|
|
|
listBox1.BackColor = this.BackColor;
Hope this will work.
Thanks,
Anand.
|
|
|
|
|
I have an Image in the Background (on the containing Form). So Setting the List's color to a single Color wont help.
Thanks for Replying. I Appreciate it...
|
|
|
|
|
Any Link to Round Edges Labels Please
|
|
|
|
|
Much like the round buttons here,
at CP[^]
SkyWalker
|
|
|
|
|
i want to resize the controls in a panel at runtime when i change the size of the window or if i dock any other panel....
not only resizing but also adjusting its position at runtime....
can any one help me out....
|
|
|
|
|
Control.Location
Control.Size
|
|
|
|
|
ya its ok..
but how could i know to reduce or enhance the size or location place.
resizing can be done in either wise na..
sorry to say that i am quite new to .net and C#
|
|
|
|
|
Hi
I need the "% Processor Time" counter from teh "Processor" category from the Performance counters...so I do this
System.Diagnostics.PerformanceCounter cpu = new System.Diagnostics.PerformanceCounter();
cpu.CategoryName = "Processor";
cpu.CounterName = "% Processor Time";
cpu.InstanceName = "_Total";
long rawValue = cpu.RawValue;
float percentValue = cpu.NextValue();
As the comments say, the cpu.NextValue() returns zero and the RawValue gives something like the following :-
Raw Usage : 919324765625
Raw Usage : 919329687500
Raw Usage : 919334453125
This is a dual processor machine, running constantly at about 50% (according to perfmon).
Any ideas why I can't get the %age value or how to convert raw value to a percentage?
Cheers
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Bizarre! - Call cpu.NextValue(); twice?
System.Diagnostics.PerformanceCounter cpu = new System.Diagnostics.PerformanceCounter();
cpu.CategoryName = "Processor";
cpu.CounterName = "% Processor Time";
cpu.InstanceName = "_Total";
cpu.NextValue();
float percentValue = cpu.NextValue();
Removing the first call to cpu.NextValue causes the second call to return zero.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
what gets measured must be in between the first and second NextValue and must take sufficient
time so the counters actually get updated. Google "performance nextvalue" and everything
will be revealed. Google knows everything.
|
|
|
|
|
And the penny / dime / ringgit / zloty etc finally drops!
The values are specific to *my* instance of the performance counter. I thought they were all stored magically somewhere and we just hook into this central store of counters and pulled values at will. But they only actually 'count' when we have an instance of the PerformanceCounter....all makes perfect sense now.
Thanks!
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Malcolm Smart wrote: penny / dime / ringgit / zloty
May I suggest You switch to Euros like the rest of us ?
|
|
|
|
|
Luc Pattyn wrote: Google knows everything.
Almost like the Jedi Archives in Star Wars
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I prefer the Ancients in Stargate-1
|
|
|
|
|
Luc Pattyn wrote: I prefer the Ancients in Stargate-1
Oh yeah, they were good too
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have an application that loads an image (having the role of a background image) and next to it, in a panel to the right, there are loaded some more images, small ones, representing various objects - those images are loaded each in it's own panel (smaller panels that the one containing them all).
The main picture (the background) is loaded in a PictureBox and it is divided in some regions (I store the pairs of points that define each region in a text file)
The objects should allow to be dragged and dropped over the regions they belong to (at first, when the objects were uploaded, they were each associated to at least one of the regions, the regions being previously defined).
HERE IS MY PROBLEM:
I can't mannage to make the drag and drop operation work the way that i want!!!
My code looks something like this:
private void Panel_MouseDown(object sender, MouseEventArgs e)
{
isDragged = true;
clickX = e.X;
clickY = e.Y;
}
private void Panel_MouseUp(object sender, MouseEventArgs e)
{
isDragged = false;
}
private void Panel_MouseMove(object sender, MouseEventArgs e)
{
Panel p = (Panel)sender;
isDragged == true)
{
if(!pictureBox1.Controls.Contains(p))
{
this.pictureBox1.Controls.Add(p);
}
p.Left = e.X + p.Left - clickX;
p.Top = e.Y + p.Top - clickY;
}
}
This code allows the panel loaded with that object to move anywhere in the window! The issue is that the application is addressed to kindergarden children, so it should be safer to use: this is why I want to limit the movement of the "object-panel" within the PictureBox, so that it couldn't leave its margins!!!
How do I do that???
Do you have any idea how can I check if an "object-panel" is dragged in the right region? Do you know any posibility to determine if an object positioned at the coordinates (x, y) is included inside a certain region (defined through pairs of points as mentioned above)???
I could really use your help!!!
Good gives us the power of creating the future. Use this power with reason.
|
|
|
|
|
This might help. First thing I found on programmatically moving the mouse.
http://www.thescripts.com/forum/thread501540.html[^]
-- modified at 10:43 Friday 20th July, 2007
Using the link above, this is an example of how to trap the mouse in a PictureBox , which should be hard to change to only trap while dragging.
private bool trap = false;
private void pictureBox1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e) {
trap = true;
}
private void Form1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e) {
if (trap) {
if (e.X < pictureBox1.Left) {
mouse_event(MouseFlags.Move, 1, 0, 0, UIntPtr.Zero);
}
if (e.X > pictureBox1.Left + pictureBox1.Width) {
mouse_event(MouseFlags.Move, -1, 0, 0, UIntPtr.Zero);
}
if (e.Y < pictureBox1.Top) {
mouse_event(MouseFlags.Move, 0, 1, 0, UIntPtr.Zero);
}
if (e.Y > pictureBox1.Top + pictureBox1.Height) {
mouse_event(MouseFlags.Move, 0, -1, 0, UIntPtr.Zero);
}
}
}
const int MK_LBUTTON = 0x0001;
enum Messages {
WM_LBUTTONDOWN = 0x0201,
WM_LBUTTONUP = 0x0202
}
[Flags]
enum MouseFlags {
Move = 0x0001,
LeftDown = 0x0002,
LeftUp = 0x0004,
RightDown = 0x0008,
RightUp = 0x0010,
Absolute = 0x8000
}
[System.Runtime.InteropServices.DllImport("User32.dll")]
static extern int SendMessage(IntPtr hWnd, Messages uMsg,
int wParam, IntPtr lParam);
[System.Runtime.InteropServices.DllImport("User32.dll")]
static extern void mouse_event(MouseFlags dwFlags, int dx,
int dy, int dwData, UIntPtr
dwExtraInfo);
Hehe, don't forget about Alt+F4 if you run this.
|
|
|
|
|
I found this in a CP Article[^] that might be easier to use:
[System.Runtime.InteropServices.DllImport("user32")]
static extern int SetCursorPos(int x, int y);
|
|
|
|
|
How can i exit or not to continue
the execution of statements in a certain event or function?
Just like "Exit Sub" in Visual Basic...
|
|
|
|
|
return.
Deja View - the feeling that you've seen this post before.
|
|
|
|