|
Normally a web browser is running everything in a sandbox, so that you can't access the registry.
But it is possible to use an ActiveX-Control (works in IE) that can access the registry through the .NET Framework classes.
Regards
Sebastian
|
|
|
|
|
what is the procedure of creating activex that runs on the client?
|
|
|
|
|
First you would implement the functionality to access the registry in an assembly.
Then you have to wrap (use) the assembly in a COM-Component. This could be done by creating another assembly that will serve as COM-Component, referencing your assembly that makes the registry access. This Component has to be registered at the client machine, so that you can access it through the IE. There are possibilities to auto-install the COM-Component (ActiveX)...
Regards
Sebastian
|
|
|
|
|
Thanks for the answer. but im a little confused.
id tried this folowing steps:
1. create a user control using c# and compile it.
2. creating a simple web apllication(aspx) and adding a reference to my user control(browsing to the dll file).
im confused about the following steps.
how do i register the user control to the client machine?
|
|
|
|
|
Well, wrap the user control within another assembly. Mark this assembly as COM-Interop (in Visual Studio, go to the settings-dialog of your project and check the "Register for COM-Interop" box). Then you have created an assembly than allows COM-Interop. This assembly has to be registered on your clients PC. You could build a cab file, or a msi that the user has to download and install on his pc (this will register the assembly on your clients PC). There is some kind of automated install, but for this you have to search, because I don't know exactly how this works.
But while developing the app you can test it on your own pc, just build the project on your PC (this will register the assembly for COM-Interop) and then call the assembly with javascript from your website.
This will looks similar to this:
<br />
<script language="javascript"><br />
function CallMyCom() {<br />
var myCom = new ActiveXObject("MyNamespace.MyClass");<br />
alert(myCom.SayHello());<br />
}<br />
</script><br />
SayHello is a method from your assembly containing a class MyNamespace.MyClass.
Hope this helps you,
Regards
Sebastian
|
|
|
|
|
Haimbert wrote: how can i access a user registry through a web browser(on acceptance ofcourse).
Write your own web browser application, and run it as administrator.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Given the question thats a bit unlikely I suspect
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi!
I have a serious problem.
I have some text that is written by a TextRenderer. And now i want on some part of it an link with underline, different color and so on.
I have searched many hours but found nothing.
Has somebody a solution?
|
|
|
|
|
The color, underline etc of a link is control by the style. You can define what these attributes are by using styles, preferably in CSS. If you want the code for the actual link google for href, that should get you going.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thanks for your answer.
the problem is, that i want to make a part of the text clickable. i don't know how to insert a link in the text the textrenderer produced.
have you got an idea about this?
|
|
|
|
|
Yes, as I said, you need to put the link text in a href - just like any link. If you dont know what I mean, just google for href. How you put in around your text in a textrenderer is for you to work out.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hello,
is it a way to share variables between c# and sql server 2005
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
You can share values, not variables, in a certain number of ways. Via SQL tables, for instance.
|
|
|
|
|
i have created a user control Dynamically and added it to panel as a child. now if i remoove it from panel but it still remains in memory.
i want it to be permanently removed from memory. There is no Dispose method available. and i also tried by implementing idisposable interface and overwriting the Dispose() method but it still remain in memory.
Is there any way to remove this object(User Control) from memory
Regards
Rishi
|
|
|
|
|
RishiKasnia wrote: There is no Dispose method available.
AFAIK, UserControls inherited from IDisposable and have a Dispose() method.
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
Thanks Pedram Behroozi
You r right.
Actually i was developing a Windows Appl Using WPF.
in my case i need to remove this user control from memory . becoz after removing it from canvas or panel , if i try to fire some event then this Control also respond the event (Though it has been removed).
for a workaround i detached the Event Handler for user control(when i remove it from canvas/panel). but it still resides in memory and remains throughout the program execution (becoz this control is not local to any Block) thus degrading performance .
Regards
Rishi
|
|
|
|
|
Well I know nothing about WPF UserControls and unfortunately I can't help you.
I think it's better for you to ask it in WPF / WCF / WF Forum[^].
Regards
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
It ok Pedram Behroozi
i have also posted the problem in WPF section but did't get any resonable ans.
anyways thanks.
|
|
|
|
|
Removing instances from memory is the Garbage Collector's job. You don't have much control over when that gets done. But you can do cleanups inside the Dispose method. So basically you remove your event handlers in the Dispose method, and simply calle the Dispose method when you remove your control from the panel. (Typically Dispose is called for all the controls in a Form from within the Close method of the Form).
Also if you control is hanging around in memory long after you have removed it, it could mean that you have some references to it somewhere in your program.
|
|
|
|
|
I didn't realise you were using WPF.
WPF controls don't have Dispose methods because they don't need them. WPF controls don't use any unmanaged resources.
To release the memory used by a WPF control all you have to do is make sure you have no references to it, and the garbage collector will automatically clear up all the memory next time it runs.
Events are something to watch out for. Remember that the event source holds a reference to the event sink, so yes if you have a control sinking events from a source on a main form, then you will need to make sure you detach the event handlers if you want the control to be released.
Note that the garbage collector does not immediately remove the object from memory. the GC only runs occasionally, and when there is a requirement for more memory than is available. This is normal behaviour and there is nothing wrong with it. if you want to test things you can call GC.Collect() to force a collection and see if your memory is cleared up, but you shouldn't leave this in the code when you release it. The GC is carefully balanced, and forcing unnecessary collections can really screw up it's performance.
If you are still having problems getting the object to be cleared up, you can use WinDbg and SOS to peer deeper into the objects on the heap and work out why they aren't being collected. (Getting started with WinDbg & SOS[^],
How to find a GC leak[^], Memory leak detection in .Net[^])
Simon
|
|
|
|
|
Thanks Simon
|
|
|
|
|
Hello,
Are there side effects of setting Socket.ReceiveBufferSize to a large value (e.g. 50 MB)?
I am writing an application to receive and process a large amount of data. Instead of writing code to read data asynchronously, I was thinking of setting Socket.ReceiveBufferSize to a large number. I am not worried about consuming system resources since the program will run on a dedicated machine. However, I am not sure whether this might have a negative effect over performance, or any other side effects that I should take care of.
FWIW, my application simply uses StreamReader.ReadLine() over the socket's network stream.
Thanks a lot
|
|
|
|
|
What do you hope to gain by setting the receive buffer size that large?
Even if the system lets you do it, it will most likely hurt performance.
Why not try it and see what happens?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
By setting the receive buffer so large, I am hoping to avoid having to read data in a thread and process it in another one. At certain (and few) instances of time, I will be receiving 3X data, where X is the amount of data I can process per second. However, right following that, there will be 0.1X data for some time. So, instead of having to synchronize reader and processor threads, I was hoping the system buffer could just hold the additional data for me.
Meanwhile, I don't think I can test performance right now, because there are many other factors that I might not be able to control. So, why do you think it would hurt performance?
Thanks for your help.
|
|
|
|
|
AFAIK, Windows Sockets will let you set it to a max size of 1MB.
The receive buffer isn't meant to be a data store.
For best TCP/IP performance, your user-mode code should remove ("receive")
data from the socket ASAP. i.e. Send buffer should be full, receive buffer should
be empty.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|