|
Did you know that reposting a stupid question isn't going to get you any better answers. You've been told what you should be looking for, but apparently you're dumber than a fly in cowshit.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
you are still dumb ,you should give solution or shutup
|
|
|
|
|
amrreko wrote: you are still dumb ,you should give solution or shutup
TO WHAT!? YOU HAVEN'T ASKED AN INTELLIGIBLE QUESTION!
And no, noone is just going to give you the code for your problem. If you're going for a degree, you damn well better have the ability to do research on problems like this, otherwise, quit now and save yourself the embarassment of failing in the front of the entire class.
|
|
|
|
|
sorry man i just became bored
|
|
|
|
|
Hey dumbshit, I already told you where to find your answer. Now, let's see - who does this for a living? Is it you? Ooh, no it isn't. Is it me? Why yes it is, and I'm good enough to even own a successful software company. How about you? How are you doing on this front?
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I am using UnixCrypt class file for encryption in my application.
I have confusion to passing the parameters to the Crypt method.
There are Two methods are available,
UnixCrypt.Crypt("Text To be Encrypt");
UnixCrypt.Crypt(Salt character ,TextTo be encrypt);
My PAssword is : encrypt8
Note :
can u any one plz clearly tell me the parameter which i have to pass to the proper Crypt method. What is meant by the Salt characters.
Plz let me clear my dowts.
regards,
kannak
|
|
|
|
|
http://en.wikipedia.org/wiki/Salt_%28cryptography%29[^]
Salt is basically a second password, but one generally used for an entire password database. In other words, a server would have a single salt key, used for all the passwords. It modifies the encryption algorithm so if the database is stolen without the salt key, it's exponentially more difficult to crack.
|
|
|
|
|
Both are static members. If you use the first method, it will randomly generate the salt characters for you and then call the second method. Salt, in this case, are two letters that are used to provide some extra randomness for the encryption, and allow you to repeat any previous encryption (if you also have the text that was encrypted).
Another thing users should know is that the text to encrypt should not be more then 8 characters long. If your text is longer than 8 characters, only the first 8 are used and the rest is ignored.
|
|
|
|
|
Hi huys
I have small issue, look at my code below:
HttpPostedFile myFile = files.PostedFile;
string strFilename = Path.GetFileName(myFile.FileName);
string[] lines = File.ReadAllLines(strFilename);
foreach (string s in lines)
{
string[] fragments = s.Split(',');
errors.Text += fragments[0] + " ";
errors.Visible = true;
}
The contents of my file look like:
Kiss,Simwaba,morgan@domain.co.za,0743720187,1987/12/31
Person,Simwaba,morgan@domain.co.za,0743720187,1987/12/31
what happens is that when i pick
errors.Text += fragments[0];
it returns "Kiss Person" which are the first index[0]s in both lines.
I just want to retrieve "Kiss" how can I do this?
Please help me in case am making a mistake somewhere.
Morg
|
|
|
|
|
It is concatenating both parts in the loop (underlined)
foreach (string s in lines)
{
string[] fragments = s.Split(',');
errors.Text += fragments[0] + " ";
errors.Visible = true;
}
I'm not sure what you want it to do from there. You either need to create a list of errors and add in turn, or return the error inside the loop if you want to stop processing.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Keith Barrow wrote: errors.Text += fragments[0] + " ";
oh yes I know that, but first when i put:
foreach (string s in lines)
{
string[] fragments = s.Split(',');
errors.Text = fragments[0];
errors.Visible = true;
}
then it will give me the first index[0] in the last line(Person) not (Kiss). File contents:
Kiss,Simwaba,morgan@domain.co.za,0743720187,1987/12/31
Person,Simwaba,morgan@domain.co.za,0743720187,1987/12/31
and if I do this:
foreach (string s in lines)
{
string[] fragments = s.Split(',');
errors.Text += fragments[0];
errors.Visible = true;
}
then it will give me both "Person" and "Kiss". But I only want to retrieve "Kiss"
the first index[0] in the first line.
Do you think am screwing up somewhere?
|
|
|
|
|
Like I said, it's your loop. If you only ever want to process the first line, this is the job:
string[] fragments = lines[0].Split(',');
errors.Text += fragments[0];
errors.Visible = true
I think I'm missing the point, as you must have put the loop in for a reason.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
You are a star man, exactly what I want to do...
Thanks again
|
|
|
|
|
No probs, somtimes the hardest ones to spot are the easiest.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Cool,
hey now another problem is that what if I don't know
the number of lines a file has, how can I deal with this line:
string[] fragments = lines[0].Split(',');
especially if I want to read all the lines of that file
and I don't know how many lines the file has.
Thanks for being helpful man
|
|
|
|
|
The code I posted only reads the first line, and will throw an error if the file is empty
To process the whole file you need the loop. You need to decide how you are going to handle it. The way I see it you have a few realistic options:
- Create a list of errors and add to it in the loop.
- Only register the first error and continue processing.
- Break out of the loop if an error is found.
Which of these apply?
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Cool bro I have figured it out check below:
manager = new data_manager();
HttpPostedFile myFile = files.PostedFile;
string strFilename = Path.GetFileName(myFile.FileName);
if (strFilename != "")
{
string[] lines = File.ReadAllLines(strFilename);
for (int b = 0; b < lines.Length; b++)
{
string[] fragments = lines[b].Split(',');
int count = lines.Length;
errors.Text = fragments[0] + count.ToString();
errors.Visible = true;
string first = fragments[0]; string last = fragments[1]; string email = fragments[2];
string phone = fragments[3]; string birth = fragments[4];
string addrecord = manager.AddContact(first, last, email, phone, birth, Request.QueryString["userid"]);
if (addrecord == "done")
{
error.Text = "Contact added check in the table below!";
error.Visible = true;
FillContacts(Request.QueryString["userid"]);
}
else
{
error.Text = addrecord;
error.Visible = true;
}
}
}
else
{
errors.Text = "No file with content was selected";
errors.Visible = true;
}
and this works quiet well....super!
|
|
|
|
|
You use indexof and substring function to retrieve only "Kiss".
foreach (string s in lines)
{
int i = s.indexof(',');
string sub = s.substring(0,i);
}
|
|
|
|
|
Because that is far more succinct than he currently has. Also, when he needs to process other elements your code should much easier to do than in than his own. Oh, hang on everything, except this sentence) is a whopping lie.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
i just give him answer. I think i forgot to remove foreach loop....
|
|
|
|
|
Actually, it looks more like the thing you needed to change you didn't and vice versa.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
hmmmmmm k i ll. Any way wat succit..
|
|
|
|
|
Uni-Vote all you like, my rep'll take it
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Nope. I've run that through every possible combination of Google Translate and it keeps coming back with the same response: You're a dribbling idiot.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Bad news for you mate. Under the new reputation system, your points total goes down everytime you post something stupid. It's only the daily cap limit that's stopping your reputation being minus several hundred thousand.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|