|
Define "client ID". We use a lot of remoting in our application and deal with lots of stuff like that. I just need to understand your circumstances. Is it unique to a machine (perhaps an IP address)? A user identity? A client application version or client name (like a user agent for browsers)?
-----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-----
|
|
|
|
|
In my software, I only need to distinguish sessions in the method calls. So I can generate a GUID in the client. But how can I passed to the server in SingleCall objects?
|
|
|
|
|
Well, there's always the CallContext , which you said you didn't want to use but this is a good purpose for it. What's wrong with it? It's just another part of the remoting infrastructure. Both creating your own RealProxy and adding a channel sink could possibly do this, but it's a lot more work and not easily accessible to the SAO itself, since creating your own proxy is more for modifying the params, returns, etc. of a message, and channel sinks are for manipulating the message typically without modifying the content (like compression, encryption, routing, etc.).
-----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-----
|
|
|
|
|
Very thanks! I don't want to use CallContext only because it will transmit all CallContext object content in both call and return, and it will use some network bandwidth.
|
|
|
|
|
The other methods I mentioned will be much harder to use. Frankly, the serialized ILogicalThreadAffinative implementation doesn't have to take much room if you just encapsulate basic Types like a String or a Guid . The channel sinks could take even more bandwidth than a CallContext if you're not mindful of the implementation. Besides, setting and getting objects from a CallContext is a heck of a lot easier than dealing with channel sinks. Once you read about them (again, that ".NET Remoting" book is good and gets in to that), I'm sure you'll agree!
Oh, and if you use CallContext.FreeNamedDataSlot in the server method with the name you used in the CallContext.SetData call on the client, there shouldn't be anything serialized and sent back in the return message. This could save you bandwidth easily.
-----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-----
|
|
|
|
|
Yes, you are right, and I also think CallContext is the better way in my solution, if HttpContext is invalid.
And thank you again for your help
|
|
|
|
|
hi,
i need to send web request to server.but i need to send request from using universal proxie servers. any one help to me. thanks in advance.
Murali.M
|
|
|
|
|
You mean send a request through a proxy? See the HttpWebRequest.Proxy property. There already is a WebProxy class that lets you specify the host, port, a list of addresses that don't require the proxy, and user credentials if logins are required. If this isn't sufficient, you'll notice that the HttpWebRequest.Proxy property is of type IWebProxy , you can implement that interface and make your own proxy. Set the proxy instance and call HttpWebRequest.GetResponse (inherited from WebRequest , so you'll have to cast the return to an HttpWebResponse for HTTP-specific properties).
-----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-----
|
|
|
|
|
Hi,
thanks for ur help.
Have A Nice Day!
|
|
|
|
|
I wish to use the Dock property, but I need a 10 pixel inset on all 4 sides.
Let's say I am creating a simple editor. I place a TextBox control on a Form, but I'd like 10 pixel insets on every side of the TextBox.
One way:
Add a panel to the form, position the panel with 10 pixel insets on all 4 sides, and Anchor to all 4 sides. Then, attach the (Dock=Fill) TextBox to the panel panel.
Is there any way to do this without using a Panel like this?
I realize that if all I was creating was a text editor, then I could just Anchor the text box to all side of the form, and position the text box correctly, but, my real application is a bit more complicated. There are several controls inside the form - including a splitter. So, I can't really use Anchor for every case.
The crux of the problem is that when using the Dock property, the child control is docked right up against the edge of its parent. I was wondering if there was a property that could buffer or inset that child control.
I'd like to avoid having to add a Panel to my application everytime I want to position something just the way I like it - while using the Dock property. How about a thick transparent border?
FormBorderStyle will not work. I am working inside the form.
I'd also like to do this same thing for controls inside the form attached to parent Panels. I see that Panel can have a BorderStyle. Is there a way I can somehow customize the actual border?
I google "custom borders in C#" or something.
Thanks,
-Luther
|
|
|
|
|
As for the docking, you could use panels, which derive from ScrollableControl which has a DockPadding property. Dock you panels, set the padding, and you can dock or anchor your controls inside those.
In regard to drawing a border, you can use simple owner-drawing by overriding OnPaint and drawing a rectangle (see the ControlPaint class for some handy helper methods), or go so far as to override WndProc and do it a little lower-level. I'd recommend the managed way for portability and ease, though!
-----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-----
|
|
|
|
|
|
lutherbaker wrote:
wow.
Heh, I think that's what we all say to Heath's posts...
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
The first method works, and provides my insets.
But regarding option #2, the point of the border was to "pad" the form. I do in fact, get the border to draw, but the child controls still Dock against the edges of the form, overlapping even the border I am drawing.
Should I somehow affect the Form.ClientRectangle {get;} before forwarding to base.OnPaint () so that the border I've drawn is not overlapped by child controls? Or shall I work it out by attaching child controls to a singular, centered child Panel again?
Also - what is the Form.ClipRectangle represent? The area that needs repainting? In my little app, its always 0,0,0,0. Shouldn't it be equal to the Form.ClientRectangle? It is 0,0,0,0 every time OnPaint gets called. Even when the app is completely hidden by other windows - and then pulled to the front.
Regardless, thats just neat stuff.
Thanks,
-Luther
|
|
|
|
|
You mean the PaintEventArgs.ClipRectangle ? The clipping region is the area that has been invalidated and needs repainting, yes. This will not affect the controls themselves, however (as you've noticed). In order to do that, you have to position the child controls. Changing this clipping region will have no affect, other than perhaps not painting all the invalidated regions.
As far as it being straight zeros all the time, this doesn't seem right. Try overlapping it party with another window, or opening a dialog on your app and see if the clipping region is something else. I've done quite a bit of this and have never seen an "empty" rectangle. My other suspision is that - since the default value for numeric types of which Rectangle is made is 0, that you might have some bug in your code (no offense - just meant as another possibility).
On a side note, clipping regions are often used to make non-rectangular dialogs, like Windows Media Player, RealOne, etc. Windows Layers are a better alternative but is only supported in Win2K and up and isn't as easy to program (though better in the long-run).
-----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-----
|
|
|
|
|
Hi,
SystemColors provides access to user specified system colors.
Is there such a class for user specified system fonts? IE: Message Box? Menu, Selected Items, Active Title Bar, Inactive Title Bar? Window Text?
Thanks,
-Luther
|
|
|
|
|
Control.Font uses the DEFAULT_GUI_FONT , the stock object (see GetStockObject in the PSDK) for controls, menus, etc., if available. You can get the font used specifically for menus from SystemInformation.MenuFont . As far as the caption bar fonts go, there isn't any managed way to do this.
-----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-----
|
|
|
|
|
|
Hello,
I am trying to add a feature to my text editor that will allow the user to select multiple files in an explorer window, then right click and push "open with" and select my program. However, after testing this, I've realized that only one of the selected files is actually passed as a command line argument to my program. How can I find out what other files are selected so that I can open them also?
Thanks,
Blake
|
|
|
|
|
Do you know of any programs that support this feature? I can't find any. I tried all sorts of applications.
I'm thinking it's a limitation of the OS (shell in particular) and not something you can work around.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Textpad (www.textpad.com) supports it. So do zipping utilities like winzip and winrar.
|
|
|
|
|
At least from what I can tell on my installation, Textpad doesn't really support opening multiple files with "Open with...", it creates a new menu entry (shell) for launching it.
I know Winzip and Winrar create a bunch of new shell commands as well, which is different than using "Open With...".
Are you actually selecting two files, right clicking them, selecting "Open with...", and then picking Textpad as the program and having it open both? If so, my installation doesn't do that...
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Yes, you're correct. I was using the menu entry instead of "Open with" and I had just assumed that Textpad would work the same way when using open with as it does with it's menu entry. But apparently not.
I guess now my question would be how to make a shell entry that would work like that. Any tips on how to go about finding out what files are selected?
Thanks,
Blake
|
|
|
|
|
Take a look at this article.
(It's in C++ but I'm not sure if some of these things are even possible in C# without Interops. It will give you a good starting point.)
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
OK, I guess I'm just stupid, but. I have a C# app that I created and want to send it to someone else. What needs to be sent along (with the .exe) so they can run it.
Thanks.
Larry J. Siddens
|
|
|
|
|