|
|
|
|
zebra88 wrote: Can i make this field look like as ..... rather than numbers?
Developed in Access? Or C#? WinForms? What?
If WinForms and a TetxBox, then look into PasswordChar[^]
If not, I have no idea.
modified 11-Mar-13 9:49am.
|
|
|
|
|
The typical way to store a password securely is typically not to store it at all. I know this sounds backwards, but what normally happens is that you hash the password beforehand and you save that hashed version to the database, along with the salt that you used to create the hash. Then, when you want to compare, you retrieve the row and perform the same hash using the salt that you saved to the database.
Now, before you ask, I've given you every keyword in there that you need to do this.
|
|
|
|
|
I am doing one sample project in c#. Its lik billing project. I created combobox column in datagridview. i added items to combobox if i select one item from combobox in one row tat item should not list in next row combo box. Is it possible if yes means suggest me please.
Thanks in advance
|
|
|
|
|
I have develop simple application first I take birthday from user and calculate his lucky number from sum of the values of the birthday
Ex:
'19881205'
How i get the sum of values in this string?
|
|
|
|
|
Use one of the integer methods[^] to parse it into a number and then use the Digital root method[^]. Alternatively extract each character one at a time, and sum the integer values.
Use the best guess
|
|
|
|
|
|
Long winded, but as a demo...
static void SumNumbersinDate()
{
string theDate = "19881205";
char[] dateLetters = theDate.ToCharArray();
int[] dateNumbers = new int[theDate.Length];
int sum = 0;
for (int ind = 0; ind < theDate.Length; ind++)
{
Console.WriteLine("Current Total: " + sum.ToString());
dateNumbers[ind] = int.Parse(dateLetters[ind].ToString());
Console.WriteLine("Adding: " + dateNumbers[ind].ToString());
sum += dateNumbers[ind];
Console.WriteLine("New Total: " + sum.ToString());
}
Console.WriteLine("The sum of the numbers is: " + sum.ToString());
Console.WriteLine("Press any key to close the demo...");
Console.ReadKey(true);
}
|
|
|
|
|
|
Integer.TryParse is often the best solution since it ensures you are parsing an integer and if not, does not throw an error.
|
|
|
|
|
Do you also have to verify that a date is valid?
I'd hazard a guess that maybe you should.
Garbage-In = Garbage-Out
Q. Hey man! have you sorted out the finite soup machine?
A. Why yes, it's celery or tomato.
|
|
|
|
|
Since OP needs this to calculate a "lucky number" I wouldn't worry too much about "garbage".
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
|
Don't bump your question, it is bad manners.
|
|
|
|
|
It's also spectacularly stupid when your question is already at the top of the list...
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
I did wonder if he double submitted, but the I realised the site protects against this and the time-stamp was 10 minutes apart.
[Edit]
I'm back off to bed, I've lost the ability to type.
|
|
|
|
|
You might wanted to enter the text here[^].
|
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
I kindly ask you to not to repost.
|
|
|
|
|
obviously a member of a rarefaction. (it's an audio joke)
Q. Hey man! have you sorted out the finite soup machine?
A. Why yes, it's celery or tomato.
|
|
|
|
|
Hey Guys, I am kind of looking around at a couple different places for answers here, got some help from some great folks here before so here goes!
I am working on, same project as I have always been working on, just adding more stuff lol. In this project I want to call an ini setting into a combo box. Here's where I am, I can list the directories into a comboBox, and I can read a line from an ini from a single location into a combo box. Now, I need to take this one step further. I need to list that ini setting in the comboBox, from within all those directories. All ini files are named the same thing, but the context is different in the ini field. So basically, I have two pieces two a puzzle figured out, that I need to make fit. Here's an example of what I can do, and what I want it to do.
//I can list the directories into a combo box using this
//Inside the FOLDERS directory are three folders, Folder1, Folder2, and Folder3.
//They are what is displayed in the comboBox.
DirectoryInfo obj = new DirectoryInfo("C:\\Users\\first.last\\Desktop\\Projects\\Test Files\\Folders\\");//you can set your directory path here
DirectoryInfo[] folders = obj.GetDirectories();
comboBox.DataSource = folders; // Populate combobox
Ok, so that's simple enough. What I want to do is take the values of my choice from the code below and list them from EACH directory into the comboBox. There could be any numbers of folders in that directory, but that shouldn't matter.
Here is how I show my ini settings now
IniFile ini = new IniFile("C:\\Users\\first.last\\Desktop\\Projects\\Test Files\\Folders\\Folder1\\Settings.txt");
comboBox.Text = ini.IniReadValue("Info", "Name");
Here's what I WANT to be populated in the comboBox at time of load.
IniFile ini = new IniFile("C:\\Users\\first.last\\Desktop\\Projects\\Test Files\\Folders\\" + Search.All.Folders.For + "\\Settings.txt");
comboBox.Text = ini.IniReadValue("Info", "Name");
I am not sure if that is even how it would be done, but I want to list that value in the combo box, for each folder that has that settings.txt.
If I need to clarify anything, please let me know, I can also provide a complete example of my source code if someone needs it zipped up for them. Thank you!
EDIT:
So I see I have gotten quite a few views of this and maybe it is a bit confusing. Here is how I theorize this happening, but needing guidance on making it a reality.
Couldn't I define folders as a string, and do something like
For Each (Folder) //(meaning it will do this block of code for each item in the string, being the folders in the specified directory)
{
IniFile ini = new IniFile("C:\\Users\\first.last\\Desktop\\Projects\\Test Files\\Folders\\" + Folder + "\\Settings.txt");
comboBox.Text = ini.IniReadValue("Info", "Name");
}
Edit #2 - I am going back through my C# tutorials because I remembered something that I learned about the while statement, I thought I could apply it in this case but am having no luck making "folders" turn into a string to even remotely make this possible. I am referring to www.learnvisualstudio.net video number 2010_02_06.
Here was my theory....
string thisFolder = folders; //I can't make this a string because it is already declared and I can't convert it to a sting implicitly...
while (folders != null)
{
//execute
IniFile ini = new IniFile("C:\\Users\\first.last\\Desktop\\Projects\\Test Files\\Folders\\" + thisFolders + "\\Settings.txt");
if (folders = null)
{
comboBox.Text = ini.IniReadValue("Info", "Name");
}
}
In my head this sounded as if it would have worked. But this just isn't the way things work lol...
modified 10-Mar-13 7:23am.
|
|
|
|
|
I'm not absolutely clear what you are trying to do - it may be that I need more coffee - but I think you are trying to supply a root folder and access all the files under that that are called "settings.txt", then read a setting value from each of those and display them all in a combobox.
If so, then I think you are trying to force the wrong methods to do the job. Lets just step back a litle and look at the task:
Find all files called "settings.txt" somewhere in a folder heiracrchy.
Well, you are locating att teh top level folders under the root ok with DirectoryInfo.GetDirectory, but that isn't quite what you want. Not only does it return a DirectoryInfo object (which contains the string you think you want in the FullName property) but there is a much, much easier way to do exactly what you want:
string[] SettingsFiles = Directory.GetFiles(@"D:\Temp\", "Settings.txt", SearchOption.AllDirectories);
foreach (string file in SettingsFiles)
{
Console.WriteLine(file);
}
You can then simply read each file since you have it's full path and name.
Doesn't this do what you want?
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|