|
Hello,
I have couple of question about if statement.
When I create password verifying program,
at least 8 characters long is
if (password.Length < 8)
valid = false;
like this, right?
Then, how can I make program that must contain at least one digit and one uppercase for the password.
Then, I tried to create
while (valid && i < 1)
{
if (!Char.IsLetter(custID[i]))
valid = false;
i++;
}
like this, but it's not working.
Please tell me.
|
|
|
|
|
|
You should be able to figure something out from the following
Password Strength Control
Regular expressions can help but they're not a silver bullet.
Q. Hey man! have you sorted out the finite soup machine?
A. Why yes, it's celery or tomato.
|
|
|
|
|
You need to read his earlier post. It's homework.
|
|
|
|
|
Ah, yes. missed that other post.
It's his own problem if he can't be bothered to *learn* and just copies stuff.
Q. Hey man! have you sorted out the finite soup machine?
A. Why yes, it's celery or tomato.
|
|
|
|
|
hi .
if(password.Length < 8) is extreme 7 character.
at least 8 character is this :
if(7<password.Length)
if(8<=password.Length)
but for second part of your question ... ! try to understand these codes and get some idea to mke your own .never copy and paste!(just a suggestion to improve your skills,ofcourse you are free to copy )
char[] Digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
if (7 < password.Length)
foreach (char t in Digits)
if (password.Contains(t))
for (int h = 65; h < 90; h++)
if (password.Contains((char)h))
break;
modified 10-Mar-13 12:05pm.
|
|
|
|
|
In C# System.Char has a number of methods including isDigit()and isLetter()
|
|
|
|
|
yea , its more simple way . thanks for remind!
|
|
|
|
|
1. Sentence Capitalizer
Write a method that accepts a string object as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument id “hello, my name is Joe. what is your name?” the method should return the string “Hello. My name is Joe. What is your name?” Write a test program that will exercise this method (and display the result on the monitor.)
2. Password verifier
Imagine you are developing a software package that requires a user to enter his/her passwords. Your software requires that the user’s password meets the following criteria.
a. It should be at least 8 characters long
b. It should contain at least one uppercase and at least one lowercase letter
c. It should have at least one digit.
Write a method that verifies that a password meets the stated criteria. Write a test program to exercise these.
----------------------------------------------------
Hello,
I am asking you about creating C# program.
These two program to create are so complicated for me.
I was trying to figure them out for 2 weeks, but it's still not.
Teacher told me both program are used by "Regex" (Regular Expression) if possible.
Could you give me suggestion or a part of the program or how to do it?
Thank you.
|
|
|
|
|
Do your own homework.
Here's a tool that may help: RegexTester[^]
If you have trouble with what you come up with, we have a Regular Expressions forum
And I suspect that your teacher may be an idiot.
|
|
|
|
|
Thank you.
I am going to see RegexTester.
And bofore that,
For just training, I am trying to use If-statement instead.
|
|
|
|
|
The description of the first problem is incorrect. If the input text is "hello, my name is Joe. what is your name? ", the output should be "Hello, my name is Joe. What is your name? ".
/ravi
|
|
|
|
|
I want to develop a desktop application & frequently i hv to send sms/emails from that s/w. so, please tell me the best Language among VB2010/C#/vb.net
|
|
|
|
|
We can't - the two are pretty much equivalent, the difference will be your understanding of the languages.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
Not sure why the one vote.... seems fairly reasonable to me.
|
|
|
|
|
Visual basic haters.
Frazzle the name say's it all
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
John F. Woods
|
|
|
|
|
Please write whole words.
Those are laguages, not platforms.
C# is best in general, but probably not best for you if you can't write any better than that.
|
|
|
|
|
Both C# and VB can be used to achieve this task.
Pick up the language you are comfortable with.
|
|
|
|
|
I have an internet on the server
I want giving the internet to some of clients, and take internet from some of them
How can i do it with C#?
excuse me, my writing in English is not very well.
but I hope that you understand my question.
|
|
|
|
|
You don't need any C# code at all. You just need an "off-the-shelf" proxy server.
|
|
|
|
|
May further explain please.
|
|
|
|
|
|
|
I have a richTextbox and in it I just need to display some formatted text. But I don't want the user to edit it. I've set the richtextBox property to readOnly and Ok, it doesn't allow the user to enter any text. But the blinking cursor still appears in the richTextBox. Is it possible to remove that too?
I need to have a RichTextBox that displays various text (in color), but the user cannot highlight or edit the text in anyway, With a regular textbox, I can set .Enabled=False and that does exactly what I want, but with the RichTextBox, setting .Enabled=False turns the box grey, and I need it to stay on the BackGround color....labels won't do, as I need individual words to be different colors.
|
|
|
|
|
vijendra58 wrote: But the blinking cursor still appears in the richTextBox. Is it possible to remove that too?
If it were a local app, yes, using P/Invokes. Being a server-app, I'd suggest using the DrawToBitmap[^]-function and display it as an image.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|