|
If you looked at the SDK documentation for HttpClientChannel , the solution is obvious: channel.Properties.Add("timeout", timeout in milliseconds)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Are you sure?
When I use the following code,
channel = new HttpClientChannel();
channel.Properties.Add("timeout",10000);
JIT throws System.NotSupportedException.
What is your suggestion?
|
|
|
|
|
I knew something about it. The timout is a new property that is introduced in .NET framework 1.1. I have changed my framework version to 1.1.
But when I use it like the following,
IDictionary props = new Hashtable();
props["timeout"] = 30000;
HttpClientChannel channel = new HttpClientChannel(props,
new SoadClientFormatterSinkProvider());
it seems the timeout(30 seconds) does not take effect.
Why? Could you help me ?
|
|
|
|
|
No, the "timeout" property has existed even before the release of 1.0 and the documentation backs this up (plus the fact I have MS Press's "Microsoft .NET Remoting" that was written about the time 1.0 was released and mentioned it.
As far as the timeout not working, are you sure it's the HttpClientChannel that's timing out? I just ask because we had a similar problem at work yesterday I worked on for a while where our remoting objects talk to SQL Server and communicate over HTTP since they're hosted by IIS. In that case, there were many timeouts: SQL Server's query timeout, the SqlCommand.CommandTimeout , the HttpClientChannel timeout (which worked, and we're using 1.0), and - in some cases - the ASP.NET worker process's timeout.
You can also configure the timeout as an arbitrary attribute in the <channel> section of your .config file (if you configure your remoting object via a configuration file). This makes it easy to change. See the docs for the element for more details.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
It sounds quite reasonable.Thank you!
|
|
|
|
|
I am currently working on a physics project that will use cdrom optics.
To do what (I hope) to do, I need to write data to a cd as a specific series of bits as far out to the cd's lead-out as possible and so I want to have full control of this rather than have to pfaff about with my cdrom software.
Is there a way to write to a cd from c#?
Oscar the Dog
|
|
|
|
|
Oscar Dog wrote:
Is there a way to write to a cd from c#?
You mean .NET? C# is just a language that targets the CLR. And while there probably is a way (did you actually try googling for one?), this would be insane. .NET languages are upper-level languages that typically require wrapper libraries, like the System.Windows.Forms assembly contains mostly wrappers of Windows Common Controls. Then you're bound to the constraints of the library which will probably be no better than your CDR software.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey I am a physicist, not a programmer. I realise .NET is a lng way removed from the hardware I want to control. The only reason for considering c# is that I am a lot more comfortable with it than C++.
Yeah, I googled for one and maybe my best bet is the Nero SDK.
Thanks, I think?
|
|
|
|
|
Hiya I have made a Service program by following one of the tutorials in Code Project. It shows you how to create a service from scratch and make an installer for the service. I have ran the installer but the service does not show in the services.
I have also tried to install the service also by using install util -i myapp.exe.
I have re-read and checked that I have done everything the document says and I have.
Does anyone know y my service will not appear??
|
|
|
|
|
I've noticed a strange problem with the services MMC and that is that if you install or uninstall a service from a command prompt it doesn't update in the Services MMC.
I wonder if the problem is as simple as restarting the Services MMC?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I have 200 jpgs that originally were a single jpg. I need to tile these back (10x20) and save it out to a single jpg. Is it possible move blocks of memory around into the correct positions to reassemble the original jpg (after striping out the jpg header)?
(Basically, I’m looking for a simple (i.e. lazy) way out without having to read through the jpeg specs.)
Thanks in advance,
Kevin
|
|
|
|
|
GDI+ will read and write jpegs, so all you need to do is create an image big enough, load the smaller ones, drawn them onto it, and save it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
I am new C# programmer, transferring from Mainframe COBOL. I am trying to learn the in's and out's of C# for a major project at work and am trying to figure out how to call another project's form depending on a user selection. I can get the user selection to work, but I cannot figure out how to get the new form to start. Both projects are in the same solution, if that helps. Can anyone help me please?
Thanks in advance!
Chuck Schmidt
|
|
|
|
|
Option 1:
Use the System::Diagnostics::Process class and run the .exe of the form.
Option 2:
Call ShowDialog() on the form.
|
|
|
|
|
That won't work without remoting. That executes the entry point of the application which usually calls Application.Run , but a calling app has no control over that without using remoting.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Don't think of projects - think of assemblies. Just like you create a form from the System.Windows.Forms, you do from another projects. One cool trick in VS.NET is to add a project reference as a dependency to the project that needs it. Just right-click on the project that needs a class from the other project, click Add Reference, then click the Projects tab. Double-click the project to add it and click OK to close the dialog. The great thing about this is that when you do a Debug, Release, or custom build configuration, the appropriate assembly reference is used.
To use a form in another assembly, just instantiate the class (using the fully-qualified type name (namespace + class), or add using namespace; at the top of your source file. Instantiate the form like any other.
Now, if these two projects run side-by-side (both executing individually at the same time), you'll need to use remoting. Doing what the other person mentioned won't work - you can only execute a program's entry point that way.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That is sort of what I ended up doing. I started the project over and created the other forms I needed in the same project, instead of separate projects for each form, and then instantiated an instance of the form with the ShowDialog method to display it.
Thanks for the replies>
Chuck Schmidt
|
|
|
|
|
I'm having a problem getting my program to restore from the system tray. Minimizing to it is no problem.
private void FormMain_SizeChanged(object sender, System.EventArgs e)
{
if ( this.WindowState == FormWindowState.Minimized )
{
this.ShowInTaskbar = false;
this.notifyIcon.Visible = true;
}
}
And restoring it:
private void notifyIcon_DoubleClick(object sender, System.EventArgs e)
{
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal;
notifyIcon.Visible = false;
}
But I'm getting this error before the program is shown in the taskbar:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll
Additional information: Error creating window handle.
Any ideas?
|
|
|
|
|
Sorry, forgot to sign in.
|
|
|
|
|
Is it possible to have the tab key work inside of a property grid? So that when a user is editing properties, they can just hit tab to go through the list of properties?
Or is there some other key that does this with a property grid?
|
|
|
|
|
Dear all ,
if anybody know how to deal with USB port by C# ,could you send me the function that i have to use , i feel that it is not as easy as COM (RS232) programming so can you help me with it
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I found this article link[^] really helpful when I was trying to access a Cypress USB device through C#. Please note that it uses managed and unmanaged C++ to do the communications (not exactly what you want I imagine). If anyone else has any other information on how to communicate directly using C# I would also be interested.
Cass
|
|
|
|
|
Thank you for that information . i have found another help full document about usb you can find it in the following web site : www.usb.org
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I have an application written in C#... nothing really special about it but for some odd reason it loses all focus and becomes non-responsive after I tab onto another application. In the windows ALT-TAB list I see a WindowsFormsParkingWindow...
What is this and why is my app dying? No one on the web seems to know why this is happening.
modified 30-Aug-22 21:01pm.
|
|
|
|