|
First of all, if you have questions about RemotingHelper you should contact Ingo Rammer. This forum is for general questions, and specific questions about articles on this site need to go at the bottom of the article pages.
Second, all his RemotingHelper does is encapsulate functionality that already exists. I would recommend using either ildasm.exe from the .NET Framework SDK or .NET Reflector[^] to view how his implementation works.
When you use RemotingConfiguration.Configure , you need to get references where you can. To unregister a channel, you should try using ChannelServices.GetChannel and pass that returned reference to ChannelServices.UnregisterChannel . You should be able to pass the MarshalByRefObject -derived remoting object to RemotingServices.Disconnect depending on its construction.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thks a lot for your answer;
I've try your solution. I still have a problem ...
connect :
<br />
RemotingConfiguration.Configure("file.config");<br />
m_DataMgrConnexion = (IDataManager) RemotingHelper.GetObj(typeof(IDataManager));<br />
disconnect :
<br />
ChannelServices.UnregisterChannel(ChannelServices.GetChannel("ClientChannel"));<br />
==> If I connect and disonnect Ok, but if I try to reconnect after connecting and disconnecting, I have the following error :
RemotingException : Remoting configuration failed with the exception System.Runtime.Remoting.RemotingException: Attempt to redirect activation of type 'IDataMgrRemote.IDataManager, IDataMgrRemote' which is already redirected.
at System.Runtime.Remoting.RemotingConfigInfo.AddWellKnownClientType(WellKnownClientTypeEntry entry)....
Then, I changed my disconnect method
<br />
ChannelServices.UnregisterChannel(ChannelServices.GetChannel("ClientChannel"));<br />
RemotingServices.Disconnect((IDataManager)m_DataMgrConnexion);<br />
but I've another error when I try to disconnect : Cannot call disconnect on a proxy.
Thks for u help
|
|
|
|
|
Hi, I'm making a graphic program, and I would like to use a Property Grid controls in it. Does anybode know any good tutorial on these controls?
|
|
|
|
|
Read Enhancing Design-Time Support[^] in the .NET Framework SDK. The PropertyGrid makes use of TypeConverter derivatives, UITypeEditor derivatives, ICustomTypeDescriptor implementations, and more you can find in the System.ComponentModel namespace and many of the *.Design namespaces to control what you see, from what properties are exposed (or even created for design-time only) to how certain properties are editor (like enumerations or collections).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
When running the following code
try<br />
{<br />
System.Net.IPAddress multicastaddress = System.Net.IPAddress.Parse("224.0.0.1");<br />
udpclient.JoinMulticastGroup(multicastaddress, 50); <br />
}<br />
catch ( SocketException e )<br />
{<br />
Console.WriteLine( e.ToString());<br />
}
On XP with service pack 2, I am recieving the following excetion :
"An invalid argument was supplied"
while the same code runs perfectly good on windows 2000 computers.
Any idea ?
Thanks in advance, Udi Raz
|
|
|
|
|
|
Thanks but didn't help much.
"System.Net.Sockets.SocketException: An invalid argument was supplied
at System.Net.Sockets.Socket.setMulticastOption(SocketOptionName optionName, MulticastOption MR)
at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
at System.Net.Sockets.UdpClient.JoinMulticastGroup(IPAddress multicastAddr)
at DVP.Do.AddMsgToLog(String msg, Int32 port, String ip) in c:\\dev\\net\\core\\dvp\\dvp.cs:line 664"
I tried to remove the FireWall, but still nothing. Maybe there is a security problem, maybe the XP does not allow communication through the port ????
Thanks again, Udi
|
|
|
|
|
Hello All,
I have created a helpdesk application in ASP.NET along with C#. Now i want a windows service to be run on server
I wnt a functionality in which if a problem is submitted at 10.00 the support person can set up an alarm and there must also be an automated alarm
to warn the support person to handle the problem before 2 hours of its subscripotion so at 12.00 if the problem is not solved it sends a mail to higher level support staff
now i wnt help from your side i have created a basic service. but tell me how to start of with this.
Waiting for a quick reply
|
|
|
|
|
You'll want to extend the ServiceBase class that is documented[^] in the .NET Framework SDK. If you're using VS.NET, create a new Windows Service project. With your service open (you'll see a blank, yellow background (by default)), right click and select "Create Installer". This will add an installer project that'll let you easily install your service using the installutil.exe application that's installed into %windir%\Microsoft.NET\Framework\v[FrameworkVersion], where [FrameworkVersion] is the version of the runtime you want to use to install the service (any should work so long as you don't use obsolete or new types and members).
To handle the time issue, you'll need to use one of the various Timer classes in the .NET Framework. There are 3 of them and each is suited for different tasks (though with the right coding any will work).
Consider this, however: such a scheduler already exists on your system: the Task Scheduler. In your control panel you'll find this virtual folder which you can create tasks in to run certain programs (like a "beep" application for an alarm). You can also access this programmatically using the native ITaskScheduler[^] interface. It would be easier to just write a native application to use this COM interface and it's associated class, represented by CLSID_CTaskScheduler . You could interop these interfaces in managed code, but you'll either have to create them yourself or create a dummy IDL file to forward-declare the necessary interfaces, compile it with midl.exe, then create an interop assembly using tlbimp.exe that ships with the .NET Framework SDK (that VS.NET installs by default).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello Stewart thnks alot for replying.
I am a bit new to VS.NET so thts why i think the solution that you have given may be is a bit complex of using IDL and rather i can do it using a thread in Windows service which continuosly checks up records in database and if any problem time is over it will insert a new record into alert table so whenever user opens the inbox he will have a new mail in tht alert inbox.
If any other effective solution then tell me
Thnaks Alot For Replying
|
|
|
|
|
It's not as easy as you think. Are you going to take into account resiliency (so that if the computer goes down either gracefully or not, when it comes back up the timer accounts for lost time)? What about security (what account does the service NEED to run under, i.e. what are the minimum privileges required)?
Again, this is a simple solution if you write it using native C++. The steps I outlined are only necessary if you want to do this in native code. If you're doing this as part of a managed application, you could write the implementation in native code and then P/Invoke a simple function exported from your native DLL from your managed application:
sched.dll (native)
ScheduleTask(TaskStruct task);
app.exe (managed)
P/Invoke ScheduleTask;
Declare TaskStruct;
If you are going to handle resiliency and security yourself (which the Task Scheduler already does), then you should look at the Timer classes in the .NET Framework I mentioned in my previous post. You can find these in your .NET Framework SDK that VS.NET installs by default (just click the Help menu, select Index, then type "Timer class". These are also available online at the following URLs:
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
How to Create a Flolder on a server where my database reside?
Which types of rights i required for creating folder?
Perrak shah
|
|
|
|
|
This is an open-ended question. You do not specify how you have access to the server (UNC, HTTP, FTP, etc.) or if you even have security rights to create folders. If this was on a network share, you'd simply use Directory.CreateDirectory("\\server\share\new directory") . If you don't have the necessary access rights, an UnauthorizedAccessException will be thrown. Over HTTP, FTP, etc., protocols, the method is different for each one.
Please be specific in your requests.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
You'll either need an application or service on the server that will listen for client requests and create folders on the demand of a client, or you'll to have a network share onto the server and create a folder from the client on the network share.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango
|
|
|
|
|
hej,
i'm looking for a solution to control multiplie user controls by clicking on on an item in the navbar, located at the left side
of the screen.
I can handle the NavBar, that's fine. Writing a Click Event for
each item in the NavBar seems to be the most convinient solution to
call a user control and display it alongside the navbar.
The problem: So far i simply dragged all my user controls on the form
and worked with the "visible" proprety
private void navItemAdresses_LinkClicked(object sender, MyNavbar.NavBarLinkEventArgs e)
{
usercontrol.Visible = true;
usercontrol1.Visible = false;
....
}
That's a really s... solution. Can anyone suggest me a better one?
|
|
|
|
|
If they are the same size ,why don't you put them in the same location ,and only calling this.control1.BringToFront();
that would help also you can start with your default control as you may want display it in the first.
|
|
|
|
|
That would be a solution. But i rather like to write some code that
"closes" or makes all previous selected user controls invisible.
I'm not too lazy to programm it, but actually i'm a little stuck.
A good idea is missing
|
|
|
|
|
Is there any Tool Bar control which is by default quite similar to Standard I.E explorer tool bar,which contains back forward stop refresh buttons etc.Creating such tool bar on our own will take time,so is there any available tool bar control like this.
|
|
|
|
|
No. You can have a prebuilt toolbar that supplies the buttons, but there's no way it can know what your using those buttons for and supply the code for them. You'll still have to write code behind the button click events so they'll actually do something.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it possible to stop people from being able to decompile a C# program or to 'rip' the code out of a compiled application?
Thanks.
Stephen
|
|
|
|
|
there are many obfuscation programs are available in market which you can use to secure your source code.
a good defination of obfuscator from google : )
"Obfuscator is a program that garbles a source either by encryption or by substitution of codes. This means that the source to be compiled is hard to understand and hard to debug. But during runtime it is decrypted as pure source."
|
|
|
|
|
You can make it harder by using an obfuscator. An obfuscator takes the IL and mangles it so that it is tough for decompilers to figure out the original source, while still maintaining the original logic of the program.
All said and done, with enough time and resources, a motivated person can still decompile your code.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I managed to retrieve LOCAL user & groups and list them in a listbox. Now I need to find out which localusers are "memberof" a local group. With Active Directory (using LDAP) it works, but it won't work with localuser/groups.
The last I tried:
DirectoryEntry group = new DirectoryEntry("WinNT://127.0.0.1/Administrators", "", "", AuthenticationTypes.None);<br />
<br />
foreach(object dn in group.Properties["member"] )<br />
{<br />
Console.WriteLine(dn);<br />
}
Who knows what I'm doing wrong ? Or does somebody knows the right we to handle this?
Thanks
|
|
|
|
|
Jeah, I did it (stolen from a example from codeproject.com) :
StringCollection userGps = new StringCollection();<br />
DirectoryEntry obDirEnt = new DirectoryEntry("WinNT://" + "127.0.0.1" + "/" + "Eric");<br />
object obGps = obDirEnt.Invoke("Groups");<br />
if (null != obGps)<br />
{<br />
foreach (object obGp in (IEnumerable)obGps)<br />
{<br />
DirectoryEntry obGpEnt = new DirectoryEntry(obGp);<br />
userGps.Add(obGpEnt.Name);<br />
}<br />
}
Now I only ask, why does is take so long to 'invoke' ? Is there anyway to make this go faster ?
|
|
|
|
|
Hello
i have some problem in double clik event of datagrid. i am using dragdrop functionality in datagrid to another control when i active this function then double clikc event not fire what can i do for this functionality please help me...
Priyank Gupta
|
|
|
|