|
Testing the upload speed is done by uploading something. There isn't really any substitute.
If you can adjust the chunk size during upload, you could just measure the time for each chunk and change the size according to the last results. That would also have the benefit of adjusting to changes in the upload speed during the upload.
---
b { font-weight: normal; }
|
|
|
|
|
I have created a 3D head using Poser, now I want to load that object into windows form crated by C# and also want do zooming, scrolling, rotating and moving of that object after that object load into form
Nothing's Forgotten, nothing's ever forgotten !
-- modified at 12:13 Friday 17th February, 2006
|
|
|
|
|
You're gonna need some 3rd party library to do this; there is no 3d support built into the current .NET framework (although this will change with Windows Vista's .NET version).
For now, you could use Managed DirectX[^].
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
1) I down loaded a menu bar from the NET and i installed it on a htnl page, but i can not
import it to my C# project.how can this manu bar apear in my C# web project?
2) what command is to source a webpage in to my html Sell ().
Thanks
|
|
|
|
|
ytubis wrote: 1) I down loaded a menu bar from the NET and i installed it on a htnl page, but i can not
import it to my C# project.how can this manu bar apear in my C# web project?
You'll have to ask the people that wrote the menu bar how to use it in your project.
ytubis wrote: 2) what command is to source a webpage in to my html Sell ().
Ummmm....yeah....perhaps you could rewrite this question so we could understand it?
Are you asking how to take the source of an existing webpage and import it into your C# project?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
how to use progressbar for long operation for example copying file (please give me an example for copying file with progressbar)
thanks
|
|
|
|
|
http://www.codeproject.com/cs/webservices/DimeBufferedUpload.asp
The above example uses a progress bar to upload large files.
|
|
|
|
|
Hi all,
I save attachments on the harddisk and when the user clicks on a button the file has to open as it does in Open file dialog.The problem is that the file does not open at the same time no error is posted.Please help me.
Here is the code
FileStream fs=File.OpenRead(path);
fs.Close;
path is the path of the filename
|
|
|
|
|
Better check MSDN on the FileStrem object.
Your code does nothing more than open and close the file. No data is read from it.
|
|
|
|
|
FileStream fs = new FileStream(path, FileMode.Open);
fs.Close();
|
|
|
|
|
hi friends:
* Is System.Transaction compatible with SQL Server 200 and MSDE ?
* Do the clients (of a class with System.Transaction) use a proxy DCOM or Net Remoting ? How?
Thanks in advance
|
|
|
|
|
faviochilo wrote: lass with System.Tra
Yes, System.Transaction is compatible with SQL Server 2000 and MSDE.
I'm fairly certain DCOM is used as the underlying implementation.
|
|
|
|
|
|
I want to use Packet Filter IP to drop internet packet. But I have problem to convert the IP Address Bytes into System.Byte in order to use the PF_FILTER_DESCRIPTOR struct. In the PF_FILTER_DESCRIPTOR it use PBYTE to save the source address and mask (and also for destination). The PBYTE is pointer to the long data type of IPAddress.Address (<- this will produce Int64 data type).
And also i don't want to use unsafe state (because i want my application really safe).
In MSDN I found this "This information must be passed in the host byte order." for SrcDst (and others). I have thinking if I can change the PBYTE into array of Byte, but because it take outside method (from IPHlpAPI.dll) I'm affraid to use what I think.
Thanks.
PS: Can anyone tell me where i can find how to convert Windows Data Type into C# (for example PVOID to ???) ? Thanks so much for help.
Simple mind programmers, I don't need a complicated mind.
|
|
|
|
|
Ariston Darmayuda wrote: Can anyone tell me where i can find how to convert Windows Data Type into C# (for example PVOID to ???) ? Thanks so much for help.
You might want to have a look at PInvoke.net[^].
|
|
|
|
|
You have to leave your safe little corner to interface with unmanaged data.
A PBYTE is a pointer to one or more bytes, there is no built in information on how many bytes there are, so it can't be used in safe mode. In order for the code to be safe, the compiler needs to know the exact type and size of the data.
You can't change PBYTE into an array of byte, as it isn't one. An array in .NET is an object that keeps track of a range of items, but the PBYTE pointer just points to the range itself.
Even worse, a PVOID is a untyped pointer. There is no information at all what it actually is pointing to. You have to tell the compiler what it is, and it will trust you blindly.
To copy data between managed and unmanaged data, have a look at the System.Runtime.InteropServices.Marshal class.
---
b { font-weight: normal; }
|
|
|
|
|
I thought i knew how to use Thread.Sleep until i made my own "SendKeys" class using the Win32 APIs. Below is my test code. What happens when it executes is that the Thread.Sleep delay occurs at the beginning followed by the 2 SendKeys statement. Clearly this is wrong. The intent is to execute the first SendKeys statement... pause... then execute the second SendKeys statement.
// focus textbox
this.txtTest.Focus();
// send key presses
KeysAuto keysAuto = new KeysAuto();
keysAuto.SendKeys("This is a test.{ENTER}Second Line.{ENTER}");
Thread.Sleep(1000);
keysAuto.SendKeys("This is a test #2.{ENTER}Second Line.{ENTER}");
I have been unsuccessful finding information about this oddness on the internet. Anyone had this problem and can shed some light on it for me?
|
|
|
|
|
This "oddness", as you call it, is because you don't understanding how Windows works.
You're using SendKeys to post keyboard messages (hint, hint) to your own form. OK, great! You've posted these messages, but since your very next statement puts your forms' execution thread to sleep, the message processing loop of your form (otherwise known as WndProc) can't process those messages, send the keystrokes to the TextBox, and let the TextBox repaint itself, until Thread.Sleep returns. As a quick'n'dirty "fix", you might want to let that stuff happen before you put your thread to sleep:
KeysAuto keysAuto = new KeysAuto();
keysAuto.SendKeys("This is a test.{ENTER}Second Line.{ENTER}");
Application.DoEvents();
Thread.Sleep(1000);
keysAuto.SendKeys("This is a test #2.{ENTER}Second Line.{ENTER}");
Application.DoEvents() will let your form process all pending messages before the next line executes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
"I do not know until i know." --famous philosopher
You suggestion works! Your explanation makes it clear that the SendKeys class is sending new events to the MainForm, thus explaining the delay. I was just blind to it. I see the following things happening:
--Mainform function starts execution;
--SendKeys sends keypresses; new events are stored in execution cue;
--Thread.Sleep is executed;
--SendKeys sends keypresses; new events are stored in execution cue;
--Rest of Mainform function is executed;
--Form receives and handles newly made SendKeys events;
From what i read about DoEvents, it seems to make a form multi-threaded somewhat- frees up the UI during execution. Just like the good ole days of VB6!
|
|
|
|
|
redfish34 wrote: From what i read about DoEvents, it seems to make a form multi-threaded somewhat-
It's not multi-threaded at all. Application.DocEvents() just redirects the UI thread to executing the WndProc loop to process the messages, then when the message queue is empty, returns the thread to executing your code from the next line.
VB6 worked the exact same way...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I load a text document in listbox, no problem. the text file is loaded like a list, I mean, read string by string. the next step is print preview and print the listbox contents because the listbox contents and the text file are diffrent and the listbox has a temporal contens and this is my doubt, how can I show in the printpreviewdialog and printdialog the contents of my listbox??.
ץײגضزدجىعםىلـصزתﺼﺷבֿאּסּﺫﻅﻂ
|
|
|
|
|
In a usercontrol i create a ListView control with a handler for the click event. In this usercontrol i create a new form and i send the reference of my ListView to it and also attach it to the Controls of the form(Obs: my ListView control isn't in the Controls of my usercontrol, it's only created there).
At runtime when i select an item from the ListView the handler method is executed, then the form closes and when i reopen the form(with the same attached ListView) when i try to select an item the same handler method isn't executed(Obs: Before I close the form I erase the reference of the ListView from the Controls of the form so the dispose method won't affect it)
Code:
public class myusercontrol: System.Windows.Forms.UserControl
{
....
private void InitLv()
{
this.lv = new System.Windows.Forms.ListView();
lv.Click+=new EventHandler(lv_Click);
.......
}
private void lv_Click(object sender, System.EventArgs e)
{
.......//this method is executed only once
}
private void btn_drop_Click(object sender, System.EventArgs e)
{
MyForm popup = new MyForm ();
popup.AddLv(this.lv);
....
}
}
In MyForm:
...
public void AddLv(System.Windows.Forms.ListView lv)
{
this.SuspendLayout();
this.Controls.Add(lv);
this.ResumeLayout(false);
}
public void CloseForm()
{
RemoveLVTV();// this remove de lv from Controls
this.Close();
}
nycadr
|
|
|
|
|
When you thought your thread had not posted properly, did it not occur to CHECK before posting it 3 times?
|
|
|
|
|
In a usercontrol i create a ListView control with a handler for the click event. In this usercontrol i create a new form and i send the reference of my ListView to it and also attach it to the Controls of the form(Obs: my ListView control isn't in the Controls of my usercontrol, it's only created there).
At runtime when i select an item from the ListView the handler method is executed, then the form closes and when i reopen the form(with the same attached ListView) when i try to select an item the same handler method isn't executed(Obs: Before I close the form I erase the reference of the ListView from the Controls of the form so the dispose method won't affect it)
Code:
public class myusercontrol: System.Windows.Forms.UserControl
{
....
private void InitLv()
{
this.lv = new System.Windows.Forms.ListView();
lv.Click+=new EventHandler(lv_Click);
.......
}
private void lv_Click(object sender, System.EventArgs e)
{
.......//this method is executed only once
}
private void btn_drop_Click(object sender, System.EventArgs e)
{
MyForm popup = new MyForm ();
popup.AddLv(this.lv);
....
}
}
In MyForm:
...
public void AddLv(System.Windows.Forms.ListView lv)
{
this.SuspendLayout();
this.Controls.Add(lv);
this.ResumeLayout(false);
}
public void CloseForm()
{
RemoveLVTV();// this remove de lv from Controls
this.Close();
}
|
|
|
|
|
In a usercontrol i create a ListView control with a handler for the click event. In this usercontrol i create a new form and i send the reference of my ListView to it and also attach it to the Controls of the form(Obs: my ListView control isn't in the Controls of my usercontrol, it's only created there).
At runtime when i select an item from the ListView the handler method is executed, then the form closes and when i reopen the form(with the same attached ListView) when i try to select an item the same handler method isn't executed(Obs: Before I close the form I erase the reference of the ListView from the Controls of the form so the dispose method won't affect it)
Code:
public class myusercontrol: System.Windows.Forms.UserControl
{
....
private void InitLv()
{
this.lv = new System.Windows.Forms.ListView();
lv.Click+=new EventHandler(lv_Click);
.......
}
private void lv_Click(object sender, System.EventArgs e)
{
.......//this method is executed only once
}
private void btn_drop_Click(object sender, System.EventArgs e)
{
MyForm popup = new MyForm ();
popup.AddLv(this.lv);
....
}
}
In MyForm:
...
public void AddLv(System.Windows.Forms.ListView lv)
{
this.SuspendLayout();
this.Controls.Add(lv);
this.ResumeLayout(false);
}
public void CloseForm()
{
RemoveLVTV();// this remove de lv from Controls
this.Close();
}
nycadr
|
|
|
|