|
That's OK it's nice to hear back that someone managed to solve the problem.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Hi friends
If i want to code a big project in c# in VS2005 which road must i follow?What do you advice me?
Especially i want to design it with plugin support.I write it skeleton, then other parts will be plugin or it can be developed by other coders.I want to learn what must i prepare before start coding.How must projects settings be for plugin support or for a such a big project.(For great extensibility)
I am looking for your answers.Any links , articles, advices will be very useful for me.
Thanks..
|
|
|
|
|
I'd recommend the following things (in order)
Read Tim's article on Divelements http://www.divelements.com/net/articles/plugins/plugins.asp[^] It's the first one I read and was (still is but not as good now that he doesn't provide free controls anymore )
Take a look at the SharpDevelop[^] code if you need ideas for a really big project.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
is it possible for me to convert a strig to a string array in c# and if so how??
beginner in C#
|
|
|
|
|
String has the Split method, which should be what you are looking for.
josh
|
|
|
|
|
yes andi normally use the split function for example
if i hava a string="walk,keny,go"
i will get all off the values like walk or kenny or go by setting the delimeter to ","
but supposei have a string="lets walk to the suppermarket"
is there anyway for me to access each character by themself for example i know if i was puting this in an array. array[o] would be l and array[1] would be e
???? u have any idea how i could do this? or any link to any example if it might be too tediuos to show me how to do it?????
beginner c#
|
|
|
|
|
You could use String.ToCharArray() or maybe simply call String.SubString(index, index+1).
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
what would index and index+1 be for example string.substring(0,1) and this will return the first and second element??
|
|
|
|
|
Ups, I didn't look hard enough at the docs. First parameter is the startIndex, so if you want the "l" from your example string it should be 0. Second paramter is length, so it has to be 1.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Thanks it works perfectly
kenny
|
|
|
|
|
Does it have to be a string array, if you're only using single characters then the string.ToCharArray() will do it exactly. But if you want to use strings then I think you will have to write a loop which walks through, adding them to a list as it goes.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
i would prefer it to prob be a string because as i go alopngiwant to tets my data to see what is bieng saved but everytime i try to set a textboxt.text=charArray[0] i get an error saying char cannot be converted to string
hence if it was stored in a string array i cold prob display it in the textbox or i dont know if is the way i am trying to display it is wrong.
is there a way display char in your textbox
do u have any samples onlinei could look on that shows u how to loop through a string character by character
kenny
|
|
|
|
|
keroed_edmond wrote: textboxt.text=charArray[0]
Try
textboxt.text=charArray[0].ToString();<br />
<br />
:doh:<br />
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
You don't have to convert the string at all to access the separate characters. Just use an index to access the characters:
string message = "So long and thanks for all the fish.";<br />
char c1 = message[0];
char c2 = message[35];
You can easily convert a char to a string:
string s1 = new string(c1);
string s2 = new string(c2);
There are many ways to get a single character from a string into a new string. Here are some:
textbox.Text = new string(message[0]);<br />
textbox.Text = message.SubString(0, 1);<br />
textbox.Text = new string(message.ToCharArray()[0]);<br />
textbox.Text = new string(message.ToCharArray(), 0, 1);<br />
textbox.Text = new string(message.ToCharArray(0, 1));<br />
textbox.Text = new string((char)(new StringReader(message).Read()));
---
b { font-weight: normal; }
|
|
|
|
|
Bit of an overkill for what he wants.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Yes, of course some of the alternatives are. I just thought that I'd show that there is more than one way to skin a cat.
Anyway, I'm not really sure what he wants, and frankly I don't think he is either...
---
b { font-weight: normal; }
|
|
|
|
|
keroed_edmond wrote: textboxt.text=charArray[0]
Based on that, I think he just wants to display the first character in the array.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
|
vernchen wrote: you can use split(',');
Not unless there are comma's seperating all characters If you look at the above thread you'll see that what he needed was the ToString() method
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
You can treat a regular string like a char array and just index it:
string mystring = "hello";
char h = mystring[0];
|
|
|
|
|
With an Installer class, I am overriding the Install() function.
I have read that throwing an InstallException() from within my installer DLL code, will force the setup project install to fail and cause setup to rollback.
But this causes an ugly dialog to pop up and inform the user that an exception has been thrown.
I am wondering if there is another (cleaner) way to cause the Install() to fail, and there for RollBack()?
Thanks folks.
-- modified at 16:49 Wednesday 7th June, 2006
|
|
|
|
|
Hi there, can anyone help me understand how it's possible to generate a keypair using .net 2.0 and have the private key secured with a passphrase?
Thanks
Clonus
|
|
|
|
|
Clonus wrote: generate a keypair using .net 2.0
You create a keypair by creating a new instance of the RSACryptoServiceProvider class (key size can be specified in constructor), once created you can then access the keys either through the ToXmlString method or through ExportParameters (specifying the whether to include the private keys).
Clonus wrote: private key secured with a passphrase
To do this you can use DESCryptoServiceProvider which accepts a key (but it must be a strong key) to encrypt data. To create a strong key you could use the PasswordDeriveBytes class which can take a password string and a collection of random bytes and generate a key out of this. Take a look at this article[^] on MSDN which will show how to use it. You're only solution if you go down this road is to use constant (or calculable) "salt" bytes. Perhaps the simplest (although not cryptographically secure) is to generate some random bytes once and then use these in all instances as the "salt" bytes.
There may be better ways around this but atleast these methods use the .NET Framework classes. You're welcome to write your own encryption algorithm for the password storing of the private key. It all depends on how secure you need it.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Thanks for the link Ed, however, I'm not sure how this would apply to RSA?
The example uses TripleDES, and it seems I've been playing around with this code and haven't been able to generate a public and encrypted private key yet.
Is this specific to DES only?
Sorry, "me brain just don't register this" !
|
|
|
|
|
You see, generating the public and private keys is very simple with RSA but using a passphrase on the private key of this pair is what I am trying to accomplish.
I can't seem to find any information on how to do this?
|
|
|
|