|
Senthil, i have read you article and then implemented this program
http://www.codeproject.com/KB/cpp/begininvoke.aspx[^]
But what does the exactly invokerequired() do does it checks whether message is posted in message queue if it is posted then it returns true or false.
Clear me
modified on Monday, July 21, 2008 3:57 AM
|
|
|
|
|
Mogaambo wrote: But what does the exactly invokerequired
InvokeRequired checks whether the current thread is the thread that created the control on which InvokeRequired is being called.
|
|
|
|
|
ok then y it gives 1 time true then false according to your program, it should always give false value as this thread doesn't created it.
|
|
|
|
|
If you looked at the code carefully, you would have noticed that the if (InvokeRequired) block actually passes the current method as the parameter to Invoke/BeginInvoke. The current method will therefore get called again, but this time on the UI thread, as it was passed as the delegate to Invoke/BeginInvoke, and InvokeRequired will therefore return false.
|
|
|
|
|
but this time on the UI thread
|
|
|
|
|
You do understand what Invoke or BeginInvoke does, don't you? They help you execute the delegate, that you pass as the parameter, on the UI thread. Invoke will wait until the delegate completes, BeginInvoke simply posts it to the UI message queue and returns.
Either way, the UI thread executes the delegate - this is the "second time" that you are talking about. InvokeRequired will obviously be false, since it's the UI thread that created the control on which InvokeRequired is called.
|
|
|
|
|
Hello everyone,
I am writing an Http client. Any samples for dealing with Http authentication? e.g. https, certificate?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Http authentication
I hopr you are using HttpWebRequest class. You can set the credentials to Credentials[^] property. Something like
HttpWebRequest request = WebRequest.Create(new Uri("http://somewebsite.com"));
request.Credentials = new NetworkCredential("username", "password");
|
|
|
|
|
Thanks N a v a n e e t h,
Your sample contains information about how to apply user name and password as authentication information. And also how to use the default certificate.
My question is, if the web site has some customized certificate, or the end user (e.g. my Http client) has some customized certificate, are there any samples about how to deal with it?
regards,
George
|
|
|
|
|
George_George wrote: if the web site has some customized certificate, or the end user (e.g. my Http client) has some customized certificate,
I don't know. Are you getting any error when you try to connect to a URL which has customized certificate ?
|
|
|
|
|
Thanks N a v a n e e t h,
My situation is, I have some installed certificate in IE for either web site or my personal certificate, and they are used to either access some special web site or identify for myself.
For the Http client application, I want to utilize them to access the special web site. Any ideas or reference samples?
regards,
George
|
|
|
|
|
Hey, guys.
Got a winforms / c# app that uses the webbrowser control to navigate to and then save off a screen capture of the given web site. Unfortunately, trying to run this in a batch is proving fruitless as the control throws up IE's various dialog boxes complaining of this or that, e.g. script error, unrecognized publisher, etc. Quite a few instances with different dialog / message boxes, and of course program execution comes to a halt until a human clicks OK, rendering it a bit useless for overnight batch processing.
I've played with all the options in IE, as well as the properties on the webbrowser control, to no avail. In fact, when I do something like disabling all downloadable content (activex controls, etc.), they do indeed get suppressed. Then IE gives me a dialog box complaining that it can't render the page properly because it the controls weren't downloaded!
Does anyone know how to rig this control to run in silent mode and suppress all Windows / IE dialog boxes and error messages? Or a different c# compatible approach to accomplishing the screen shots? I'd be most grateful for any enlightenment.
Thanks,
|
|
|
|
|
You dont mention specific names, so I will ask:
ScriptErrorsSuppressed = true ?
|
|
|
|
|
Hey, Leppie.
Actually tried it both ways, among other things, and neither suppressed that particular dialog (only one of many). Oddly enough, the MS doc says to set it to false to suppress the errors, which seemed like a typo, hence my trying both ways.
I've found through poking around that the IWebBrowser2 interface has a Silent property that's supposed to do what I'm talking about. However, having not spent much time on this sort of thing, I'm unsure of how to implement that interface on the web browser control. Probably COM 101 stuff, just haven't been there in C#.
|
|
|
|
|
Hi,
Can anyone direct me to the C# equivalent of the ObjectOutput and ObjectInput interfaces in java?
Regards,
Dave
|
|
|
|
|
I think that BinaryReader and BinaryWriter is what you are looking for.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello,
I am writing an application that enable user to create HTML files
but all his formatting choices are saved in a CSS file linked to his HTML file I'm writting this file by using the StreanWriter class but I don't know how to read a specific element to edit it when user changed his design.
Thanks.
Dad
|
|
|
|
|
Try using a regex to read the style from the CSS file.
|
|
|
|
|
HI,
i have several .mht files with hyper links connections
Like File1.mht has a hyper link to File2.mht
in my application there are :
1. Tree View - each node represents and load an .mht file
2. web Browser that shows that .mht
the think is that when i display File1.mht and press the hyper link to
File2.mht the web Browser shows no page can be displayed
any IDEA
Have Fun
Never forget it
|
|
|
|
|
Hi all,
I made a simple program to store wave and mp3 files with SQL Server and c#, Can I play the sound file directly from the database without creating the file to temporarily directory ....
I stored the file as binary in the database...
thanks
modified on Sunday, July 20, 2008 1:08 PM
|
|
|
|
|
|
sir , plz send the program code ..with this quote
|
|
|
|
|
Hello Forum
I am wondering what is the best way to automatically recalculate a value in a specific field.
I have on my form fields A and B these are bound to a MSSQL table and I have field C that is a result from A + B. is the way to recalculate field C to assign an on change event on fields A and B or there is another way where I can achieve this?
I am trying to avoid attaching an event on each field.
Thank you,
|
|
|
|
|
if you don't show field C in your form you don't require to raise events, other wise how you change the value of C?
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|