|
ya know I just skimmed across these responses. Should slow down a bit
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Store them as a null string.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Since you use a string for the Hash anyway, why not just call the Hash method when you need to verify and then directly compare the strings? That way, any future changes to the password system will still work as well as not duplicating code and introducing a potential source of error?
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Probably because the Hash function creates a new random salt, rather than using the same salt that was used when the stored hash was created.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
If it works from the console, but not when you retrieve the hashed password from the database, then there must be something wrong with the value stored in the database.
Try creating a hash, storing it in the database, and then immediately reading it back to see if the retrieved value matches the generated value.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Anything wrong with just encrypting the password, storing it, the encrypting the logon password and comparing both strings?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
"Encryption" means you can turn the stored value back into the original password. Don't do that.
What you've shown already is the correct way to store and verify passwords.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
OK, so I went back and looked at my Has code, and I figured out why it's not working.
The CompareHashedString method takes a hashed password and a plain text string to compare it to.
So that means I would have to pass the user's keyed in password in PLAIN TEXT to the back end, where this code lives.
Here's the Compare method again.
public static bool CompareHashedString(string hashedPWDFromDB, string passwordFromUser)
{
bool isValid = true;
byte[] salt = new byte[16];
byte[] hashBytes = Convert.FromBase64String(hashedPWDFromDB);
Array.Copy(hashBytes, 0, salt, 0, 16);
var pbdkdf2 = new Rfc2898DeriveBytes(passwordFromUser, salt, 10000);
byte[] hash = pbdkdf2.GetBytes(20);
for (int i = 0; i < 20; i++)
{
if (hashBytes[i + 16] != hash[i])
{
isValid = false;
break;
}
}
return isValid;
}
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
please how can i make a webbrowser which can reopen recently closed tabs like in the case of google chrome
|
|
|
|
|
You did not mention it so assuming you have already created some browser program with C# - you can persist the recently opened tabs temporarily and can open from this list whenever requested.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
|
best connection sql server in c# windows application(clinet/server)
|
|
|
|
|
That's not a question.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
And that tells us nothing about what help you need!
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Well, I prefer to use SqlConnection over OleDbConnection or OdbcConnection because it is a better performing solution.
This space for rent
|
|
|
|
|
|
A short one.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Agreed; no longer than 65 cm. Anything longer causes data-loss due to dem bits starving on the way.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Dear all,
I'm a new C# learner, I want to control "Chameleon3, CM3-U3-13Y3M" CCD by WinForm now.
The SDK example "FlyCapture2SimpleGUI_CSharp" could be compile and run on VS2017 system. So I created a new project and coded it by following example. I add the reference about "FlyCap2CameraControld_v140" & "FlyCapture2Managedd_v140" dll files in project. But it showed error message when it compiled. Does anyone know how to control it by C# in winform mode?
Thank you.
-------------------------------------------Error Message----------------------------------
System.BadImageFormatException
HResult=0x8007000B
Message=無法載入檔案或組件 'FlyCapture2Managedd_v140, Version=2.12.3.2, Culture=neutral, PublicKeyToken=76c6583b4a4585f4' 或其相依性的其中之一。 試圖載入格式錯誤的程式。
|
|
|
|
|
We have no idea where you got the SDK from, or the example, or even what the example is supposed to do.
Your first place to start is with the manufacturer, who you presumably got the SDK from - they will know a lot more about it and the example code than we will.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi, thanks for your reply firstly.
I got the SDK from "PointGrey's Support" download, I also send a mail to search help.
One question, does there have other way to control the CCD camera?
|
|
|
|
|
As I said, you'd have to talk to the manufacturer! There are a huge number of cameras out there, and they don't have to obey any standards ... assuming there is a standard to start with ...
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Bad Image Format usually means you're trying to use a 32-bit DLL in a 64-bit app or the other way around.
Go into your project properties and change your Platform Type from AnyCPU to x86, then recompile and see what happens.
|
|
|
|
|
Hi Dave,
Thanks for your answer, it solve the problem!!
I changed x64 to x86 and compiled pass, I could control CCD now.
Thank you.
|
|
|
|
|
Dears,
I have a C# windows form application which has an image of the world map. When the user clicks on any position on the map, I need to covert that point to Longitude and Latitude. How can I do this? Please help.
Vinu
|
|
|
|
|
Find the boundaries (x, y - topleft and x1, y2 bottomright) in the coordinate system. Make sure where you know where 0,0 is.
if your height in pixels is eg 1200 pixels you know that 1200 pixels have a range of -90 to +90 degrees (latitude). if the width is eg 1600 pixels you know that 1600 pixels have a range of -180 to +180 degrees (longitude). From there you can calculate the value of degrees 1 pixel has for the X and Y axis.
Hope this gets you started.
|
|
|
|