|
The C# compiler is tricking u a bit here:
events get expanded to:
private event
public event {add; remove;}
Thus setup your events as shown above and place the NonSerializable attribute on the private field
HTH
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Ah. Thanks for the Info.
I had another solution to the problem in the intermin. I created an inner class to house the events and the event raising functions. I then exposed the events through properties (as you've shown above). Then I marked the member variable of the class that held the events as nonserializable()
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Hi, I'm writing a Windows Service that launches a Windows App on startup. So, what I did was, in OnStart( ):
System.Diagnostics.Process process = System.Diagnostics.Process.Start("C:\\Program Files\\Testing\\ThisWinApp.exe");
I successfully installed the service using InstallUtil.exe. When I "start" the service, I keep getting "TypeInitializationException". Account used in ServiceProcessInstaller is "LocalSystem" - does it has permission to run executable and run exe in "Program Files" folder? I can't configure these rights on my XP machine.
Reference: http://www.dotnet247.com/247reference/msgs/30/150246.aspx
Anyway, I used caspol.exe to check permission on the assembly. Intersecting permission from across "level", the assembly (the Windows Service) got "Fulltrust". So, if it's got to do with security, it must be user role launching/starting the service.
Now, if it's not security, perhaps it's got to do with the fact that any class derived from ServicedBase can't launch anything that has a GUI?
Thanks in advance.
norm
|
|
|
|
|
I am familiar with symmetric and asymmetric algorithms. But I know a little about generating public and private keys in asymmetric algorithms, And this is my question:
Is it possible to generate a public key based on a private key? It's very important for me to do that.
Thanks in advance.
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Not really, but it's more a matter of semantics, you generate a key pair. The private key that is stored at keygen time is really more the 'whole key', with the public key being a subset of the information.
With what tool did you generate the private key for which you want a public key?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
You know, I actully want to use the user's password as a private key on the browser. So if the user changes his password, I want to regenerate a public key on the server for the new private key. My idea is just replacing SSL with a new approach(I am somehow sure that it is possible).
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Ah... No, I'm afraid you need to do some more reading about how RSA (and other asymetric ciphers) work.
You can't use a password as a private key, and replacing SSL is impractical for more reasons that I can cover here.
Sorry,
-Blake
|
|
|
|
|
Blake Coverett wrote:
You can't use a password as a private key
Why?
What about using it as a private key in symmetric algorithms?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Yes, excuse me, I need more studies.
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
1. How'd you delete an installed Windows Service?
I installed a Windows Service I wrote myself, then I tried to install a newer version on top, it threw an exception: "The specified service already exist"
2. How'd you delete event log on "Windows XP" - not clearing log. But to actually delete a log file. I stopped Event Log service from MMC. Then I deleted the log file under the directory:
"C:\WINDOWS\system32\config\MyCustomLog.evt"
I restarted the machine and the event log was restored.
Thanks in advance.
norm
|
|
|
|
|
You aren't suppose to be able to delete an event log, it wouldn't be very "security aware" if you were.
|
|
|
|
|
But it's not system event log (application/security...). It's one that I created myself.
norm
|
|
|
|
|
oh then try
System.Diagnostics.EventLog.Delete ("YourLogName");
|
|
|
|
|
Hey, that's good tips. Thanks. Will try that now =)
norm
|
|
|
|
|
Thanks, first of all. Just a note, I uninstalled the Windows Service:
installutil /u myservice.exe
But "myservice.exe" was the new version. I lost the assembly for the old version, Service1.exe. Is there anyway to uninstall the old version, without the assembly? I understand installutil uses information from the assembly...
norm
|
|
|
|
|
try downloading instsrv, you can get a copy from http://setiathome.berkeley.edu/service.zip, and type
instsrv "ServiceName" remove
|
|
|
|
|
Awe thankyou so much, you've just helped me solved two problems in 10 minutes!
norm
|
|
|
|
|
|
I want to disable the scroll bars in a mdi parent form...setting AutoScroll to false has no effect.
How do I do this?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hi
Did you ever find a solution to this problem? We are having exactly the same problem at our project.
Thanks for your help, Mads
|
|
|
|
|
No, I never did
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hi,
I bound a dataset to a listview (I used example of Lothka).
I have also a button delete. When I select a row in the
listview and I push delete-button I can delete the row in
the dataset as follows :
ds.Tables[0].Rows[Convert.ToInt32(item.Index)].delete();
And then I rebind my listview to the dataset.
But working with item.index is not right.
1. When I am deleting another row (say row 3). In the dataset the 2e row was deleted (that was not the same I selected in my listview).
So : listviewItem.index and the index for the rows of the
dataset doesn't match anymore after my first delete.
Same problem when I sort the listview, then there is no
match between both indexes.
What is the best way to resolve that problem?
I am looking for an example of a listview bound to an custom collection (thats not a problem, I have that). But I want to add, delete and update listviewitems adn at the same time I want that they are refected in my custom collection.
Thanks
Bom
|
|
|
|
|
i dunno.. but i seems easy ques.(may be)
I want to make a button that is capable of moving the VScroll bar of the form to a certain position or to the end.
how can i do such thing?
thx
plextoR
|
|
|
|
|
|
How can I undo un-register remoting type. Basically, I'm looking for reversing SAO or CAO registration (not channel).
RemotingConfiguration.RegisterWellKnownClientType(
typeof(nsTransactionMaster.CTransactionMaster),
"http://localhost:8085/CTransactionMasterURI"
);
RemotingConfiguration.RegisterActivatedClientType(
typeof(nsTransactionMaster.CTransactionMaster),
appurl
);
Thanks.
norm
|
|
|
|