Hi, I am playing with the HttpRequest class to try to make something work. I found that it appears, everytime you user the GetResponse() from the WebRequest, you have to initialize the object again, to get proper response in the pages that are authenticated. Is this normal, should it be like this?
WebRequest request = (HttpWebRequest) WebRequest.Create(URI);
/... do the network credentials here
/... do something else
//this line has to be here to use GetResponse() again.
request = (HttpWebRequest) WebRequest.Create(URI);
Maybe I'm showing my ignorance, but what special need is there for __asm when all you're doing is changing the contents of a file?
C# provides easy file access, just check the System.IO.FileStream and other classes within the System.IO namespace.
If you are trying to do more complicated things than merely reading and writing to the file (like trying to monkey with an already executing program), then you can try using the System.Runtime.Interop namespace to access most/all of the Windows APIs. If you still can't get there, then you can create a C++ dll to do the specific work you need, and call that from C#.
Yeah, that works. The form code generator automatically adds the code to pass the components object to the constrctor and everything.
Unfortuantly, I have not idea of how to navigate from that Component object to the actual Form object, which is what I am interested in. Any ideas?
Surely the framework includes this? Or Maybe a Component based object is not what I want here?
Basically, what I'm after is the same as the Parent property on a Control. Except I'm not building a visible control, just a component that adds some event handlers to the forms events and does some processing based on them.
BTW, the Timer was just an example, I'm not actually using a timer...
Pete Bassett wrote: just a component that adds some event handlers to the forms events and does some processing based on them.
This is a different topic now.
To get it done, you need to declare a delegate, an event object, an eventarg object, and a handler. Adding this to a Form-derived class, along with appropriate [design-time] attributes will make the event handlers show in the Form designer.
Whenever the event handler is actually subscribed for, you have internal code executed where you can process the event using another component (non-visible if you like) of yours.
All you need is a good sample to start with. There are articles about new event creation on CP (C# programming section), MSDN, ...
I think I know what you mean...I had something similar where I wanted to get the HWND of the MainAppwindow wher I would "drop" the component, although there was no interaction with the window, it still needed to know this...
I wonder how this can be done? All my attempts were failures
"There are no stupid question's, just stupid people."