|
Hi,
In JAVA, a pair of public/private keys can be generated using KeyPairGenerator. Then the getEncoded() method of public key or private key can be called to encode the key into a standard representation before sending it to a some other party. I know private key is not supposed to be sent out to a third party but still it can be encoded in a standard format as specified by PKCS#8 by using PrivateKey.getEncoded().
In .NET, a pair of keys are generated internally by an instance of RSACryptoServiceProvider. If I want to achieve the same functionality as that of JAVA's [PublicKey|PrivateKey].getEncoded() for both private and public key, how to achieve it in .NET? For example, I should be able to encode the public key in a standard format as specified in X.509 format before sending it to a third party. Similarly for private key. Any example code illustrating the same will be extremely helpful.
Regards,
P.Prasad
|
|
|
|
|
I have an application that acts as a remoting server. The app has a front end with lots of controls, and the remoting is (as it must be) a class in a class library of its own, which is instantiated by the remoting system when a call is made by a remote client (as I understand it).
I want to be able to update stuff on the screen when a remote client calls a method in the server, but I can't work out how to communicate between the server object and the rest of the application. Can anyone tell me if this is possible and how it's done.
Dave
|
|
|
|
|
When you setup the remoting on the server side, instead of allowing the remoting infrastructure to create server objects, create them yourself and register it using RemotingServices.Marshal[^]. You could then expose events from those objects and subscribe to them from the GUI. Something like
class RObject: MarhsalByRefObject
{
event SomethingChangedDelegate SomethingChanged;
public void RemoteMethod()
{
SomethingChanged();
}
}
}
class GUI
{
void RegisterRemoteObjects()
{
RObject o = new RObject();
o.SomethingChanged += ...
RemotingServices.Marshal(...);
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks Senthil. I eventually found a viable solution by getting the server class to post windows messages to the GUI. However, yours is an interesting alternative which I shall investigate. I need to understand some of these more advanced remoting techniques. Thanks.
Dave
|
|
|
|
|
Hello to all,
Actually i am very new in .Net technolgy. Can any body tell me how to make my own video server in C#.Net. For this i do to much googling. But I just found a providers of video server.
My server handle different codecs which is decoded by standered media players.
Thank You in advance.
Regards,
Divyang Mithaiwala.
|
|
|
|
|
Divyang Mithaiwala wrote: i am very new in .Net technolgy. Can any body tell me how to make my own video server in C#.Net
1. You have to learn to walk before you can run.
2. Your request is too vague. If you make an attempt at implementing a video server and have difficulty on a specific part of it then we can help, but the subject of video server design would cover a book. (or several books as there are several possible designs)
Probably a start would be to learn about sockets in .NET. And also, how much do you already know about video servers?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
hello there; I'm new to the c# platform. I created a non-rectangular form using an article i found on this site and it works fine. how do one create an eventhandler to maximise the form like a normal window's form would?
thanks.
|
|
|
|
|
Normally, custom-shaped forms don't have a maximized feature. You'd have to resive the image your form is uing for a template, then relayout and size your controls.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I am very new to DirectoryServices. I created an ActiveDirectory user by using DirectoryServices. I can find that added entry later-on aswell. But I still couldnt figure out that how can I delete an added user later.
I tried
DirectoryEntries.remove("username", DirectoryEntry.SchemalClassName);
as mentioned on MSDN, but its keep on givng me an error like:
Invalid DN name assigned. I think I have to get the GUID for user I want to delete but I have no idea how can I get the GUID for any user e.g. "testuser" in Active Directory
Can anybody help me?
Thanks in Advance!!!!
|
|
|
|
|
what is the main basic concept of .net Framework?
what will happen when a page is complied?
what things will happen inside the framework?
sowjanyakumar
|
|
|
|
|
.Net Programer and developer wrote: what is the main basic concept of .net Framework?
"The .NET Framework is the programming model for the .NET platform. The key components of the .NET Framework are the common language runtime and the .NET Framework class library, which includes ADO.NET, ASP.NET, and Windows Forms. The .NET Framework provides a managed execution environment, simplified development and deployment, and integration with a wide variety of programming languages." - .NET Framework documentation on MSDN
.Net Programer and developer wrote: what will happen when a page is complied?
You'll have to be more specific about this question. I'm guessing that your talking about an ASP.NET page...
.Net Programer and developer wrote: what things will happen inside the framework?
When? When the app is compiled or when it's run? Come on. Be more specific...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want code for brick game using dotnet framework. please help me and message me the steps,idea and code, so i could know hpw it works
|
|
|
|
|
First you're hyjacking someone elses thread.
Second, noone is just oging to "give" you anything. We're here to HELP you write code, not just hand it over.
If you want a complete explanation of how a game works, start using Google. I'm not here to do your research for you.
Start with this[^]...
|
|
|
|
|
I have been receiving this exception for over a week with a .NET remoting app and can't find a solution anywhere that works. Below I'll paste my config files and the client code calling the remote method. I'd really appreciate some assistance. The Server code and files are on a remote server within our facility and have been told more than once there is no firewall between my workstation and it. So firewalls are out of the question as the source of the problem. I assume its somewhere in my config files but I've tried everything I've seen on the net.
I receive the Net.WebException: underlying connection was closed:unable to connect to remote server exception message.
Any thoughts?
------------------------------------------------------------------------------
client config:
<configuration>
<system.runtime.remoting>
<application>
<client url="http://agiledev2.sanmina- sci.com/DataExtractService">
<wellknown type="AgileExtractNegotiator.ITNSManager, AgileExtractNegotiator"
="" url="http://agiledev2.sanmina-sci.com:1234/DataExtractService/TNSManager.soap">
<wellknown type="AgileExtractNegotiator.IDataExtractManager, AgileExtractNegotiator"
="" url="http://agiledev2.sanmina-sci.com:1234/DataExtractService/DataExtractManager.soap">
<channels>
<channel ref="http">
// <customerrors mode="off">
------------------------------------------------------------------------------
server config:
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="http" port="1234">
<lifetime leasetimeout="20M"
="" renewoncalltime="20M" leasemanagerpolltime="3M">
<service>
<wellknown mode="SingleCall"
="" type="DataExtractServer.DataExtractManager, DataExtractServer" objecturi="DataExtractManager.soap">
<wellknown mode="SingleCall"
="" type="DataExtractServer.TNSManager, DataExtractServer" objecturi="TNSManager.soap">
<customerrors mode="Off">
------------------------------------------------------------------------------
client code:
Dim app As Windows.Forms.Application
Dim rc As RemotingConfiguration
Dim strConfigFile As String = app.StartupPath.Trim & "\DataExtractLogin.exe.config"
rc.Configure(strConfigFile.Trim)
rc.CustomErrorsEnabled(False)
Dim rh As RemotingHelper = New RemotingHelper
Dim tnsm As ITNSManager = CType(rh.GetObject(GetType(ITNSManager)), ITNSManager)
Dim props As IDictionary = ChannelServices.GetChannelSinkProperties(tnsm)
props("username") = "*********"
props("password") = "********"
Dim TNS As TNSGeneral = New TNSGeneral
Try
TNS = tnsm.GetTNSInfo
Catch rEx As RemotingException
MessageBox.Show("Remoting Exception: " & rEx.Message.Trim, _
"Remoting Service Error", MessageBoxButtons.OK, MessageBoxIcon.Stop, _
MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
Exit Sub
Catch argEx As ArgumentException
MessageBox.Show("Exception: " & argEx.Message.Trim & argEx.InnerException.Message)
Exit Sub
Catch aEx As ApplicationException
MessageBox.Show("Exception: " & aEx.Message.Trim & aEx.InnerException.Message)
Exit Sub
Catch nrEx As NullReferenceException
MessageBox.Show("Exception: " & nrEx.Message.Trim & nrEx.InnerException.Message)
Exit Sub
Catch nwEx As Net.WebException
MessageBox.Show("Net Web Exception: " & nwEx.Message.Trim)
Exit Sub
Catch Ex As Exception
MessageBox.Show("Exception: " & Ex.Message.Trim & Ex.InnerException.Message)
Exit Sub
End Try
-- modified at 12:49 Wednesday 1st February, 2006
|
|
|
|
|
I have a Winforms app written under .net1.1. After it is installed on a client, it will fail to launch until such time as someone with machine admin rights logs on to the client and runs the app once. Then it works for any other non-admin user that logs on and the failure cannot be reproduced even if we subsequently remove the app and the framework and reinstall everything from ground zero.
Current theories are (1) code access security problem or (2) problem accessing isolated storage for the very first time. I use a little bit of isolated storage for form / user settings and the like. We don't consider (1) likely because it's installed on the local machine (full trust zone) , and it operates fine for non-admins once an admin runs the program on the client once. I thought of (2) because this is the first .net app deployed to the clients, and we install .net 1.1 as part of the setup process, so it's likely that nothing has ever attempted to access isolated storage on the client prior to this program.
The error message displayed when the app is launched is cryptic. It’s not even a normal .net unhandled exception dialog that displays where it was at in the call stack or displays problems related to code access security. Just "an unhandled exception has occurred, process ID XXXX, Thread ID XXXX, Click OK to terminate or Cancel to debug."
I'd love any additional theories or suggestions.
Pat
Pat K.
|
|
|
|
|
Select "Debug" and find out what the exception stacktrace is. Finding out the Exception message, inner exception etc is critical in solving these types of issues.
|
|
|
|
|
That's the fun part, it says no debugger is installed... apparently installing one requires the visual studio install cd... so I'll have to bring those to work and repeat the process on yet another clean machine and install .net debugging components if I can figure out how to do that. I can't figure out how to replicate the problem on a given machine once I've run the app as machine admin so I'll have to scrounge for more machines.
It's very weird - every other unhandled exception situation I've ever seen displays the .net "unhandled exception" dialog with a "details" button that will list where it is in the call stack when it failed, and a "continue" button. This one just has OK and Cancel and absolutely no information other than the thread and process ID.
|
|
|
|
|
Aha.. ! two options:
a) modify the code so it records the exceptions to a textfile (make sure you're taking care of Unhandled exceptions, application exceptions, and thread exceptions.
b) you dont need VS installed on that machine to be able to debug. You can remotely attach a process. From the machine that does have VS installed, select "Debug Process" from the menu. Specify the name of the computer to which you want to connect. Select the process... etc. You will be able to debug the same way as if you had the program running on your machine if you copy the build PDBs to the application folder on your remote machine also.
- Malhar
|
|
|
|
|
regarding b)
I tried this yesterday (but without PDB's present). Added self to remote machine's debugger users group. Got an error about could not debug. I read what little I could find in MS documentation about remote debugging and it said you had to do all this crap (install remote debugging components on the target machine using the VS.Net setup CD) to be able to debug a process on a remote machine. Are you saying that if the PDB files are present on the remote machine then that process is not needed? If so, I'll give it a try. The 2 clients I initially tried this on were 2000 miles away, so I did not have physical access to go install stuff from a CD. The machine I had to play with today (locally) I wrecked - i.e. accidentally forgot I was logged on as admin and launched the failing app, so that it began working for non-admin, before I got any further. Thanks for the tip, I'll see if I can stick PDB files somewhere and get some info.
|
|
|
|
|
RegistryKey.OpenSubkey method failed when attempting to wrie the first ever EventLog entry for my application. Seems I need to look into having the EventLogInstaller class do something as part of my setup package.
|
|
|
|
|
If you're creating a custom EventLog, not using the standard Application or System logs, this requires admin rights to create the new log. After that, anyone user account can write to it.
You're correct. You'll have to add a custom action to your Installer to create the new event log. Admin rights shouldn't be a concern considering you normally need admin rights to install an app anyway.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi,
Is there any way of using a web proxy (i.e. using the WebProxy class in .NET) to send e-mails through as part of an e-mail client, without changing IE Settings?
The key is that I need to be able to mask IP addresses in e-mail headers sent from my e-mail client via an SMTP server, like GMail. The headers for GMail have the IP address in them if you don't send them from thei webmail cliet, you see...
Any and all help appreciated!
|
|
|
|
|
hi,
this question look silly but i need it.
i am extracting values from a pdf file and am assinging those values to a string array of fixed length. if i get extracted value as empty ( empty string) i have to assign that particular value as NULL . (becoz i have to insert this value into the database) using null option in the vb is not working. can any body help me ....
raj
-- modified at 5:27 Wednesday 1st February, 2006
|
|
|
|
|
Use DbNull.Value.
---
b { font-weight: normal; }
|
|
|
|