|
Hi thanks for your reply. My question is related to ASP.Net MVC which encompasses C#, Razor, and Javascript, if you had read my question you would see that.
modified 24-Jun-18 4:47am.
|
|
|
|
|
We read your question but the code you posted was JavaScript.
This space for rent
|
|
|
|
|
Please go ahead and delete this post. I will find an appropriate forum for this topic.
|
|
|
|
|
Hello everybody,
Unfortunately I did not find it online or asked the wrong questions, I hope you can help me.
I am new to the world of C # and Visual Studio 2017.
I used to work with Boost in C ++ in Visual Studio 2010.
So I created a project in Windows Forms Control Library and created everything I needed to enter data about a Froms application and put my little program in there.
Then I created a second project as an application (main project) with a button.
Now I have:
After I added the project under, "Project -> Add Reference -> Browse".
Now I would like when I press in the application (main project) on my button, then the Forms
Application from the Windows Forms Control Library (Added Project).
If I conclude that firm, then I come back to the Froms main project.
Similar to a window switching
Great thanks for your help.
Manuel
|
|
|
|
|
That;'s easy - you have added the reference, so all you need to do is add a using statement:
using MyLibraryNamespaceName; And use the form as if it was part of your "normal project":
MyLibraryForm f = new MyLibraryForm();
if (f.ShowDialog() == DialogResult.OK)
{
...
}
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
hmm
using WindowsFormsControlLibrary1;
and then
WindowsFormsControlLibrary1.UserControl1 f = new WindowsFormsControlLibrary1.UserControl1();
f.ShowDialog
then comes the message CS1061:
UserControl1 does not contain a definition for ShopDialog
and if I write that then what Visual Studio suggests:
f.Show.ShowDialog
comes the message CS0119
"Control.Show ()" is "method" and not valid in the specified context.
|
|
|
|
|
Look at what you wrote:
WindowsFormsControlLibrary1.UserControl1 f = new WindowsFormsControlLibrary1.UserControl1();
That's not a form! It's a usercontrol, which is a component (like a TextBox or a DataGridView) that you can add to a form.
You can't display a usercontrol on it's own - it doesn't have the "bits and bobs" that a Form needs.
You can add it to a Form using the designer (drag and drop it from the toolbox) in either the DLL or EXE project, and display that.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
please i need a code and a library which saves audio in a compressed format like .mp3 rather than saving it in a .wav format
|
|
|
|
|
This is not a "code to order" service: we are not here to do your work for you.
If you want someone to write your code, you will have to pay - I suggest you go to Freelancer.com and ask there.
But be aware: you get what you pay for. Pay peanuts, get monkeys.
The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Ah, but that means reading further than the top line of text ...
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
How do I process the xamarin forms that connect to SQL Server and export data to the listView ? I'm looking for this simple example. What do I find on google ?
|
|
|
|
|
|
You will have some form of remote service (typically a REST service), that communicates with SQL Server. Your Xamarin app connects to the REST API (if that's what you're using) and communicates with that. It's that simple.
This space for rent
|
|
|
|
|
I'm using C# 4.5.2 & SQL Server Express 2012 RTM..
When I create a new user in my app I hash the password using
public static string Hash(string password, int iterations)
{
byte[] salt;
new RNGCryptoServiceProvider().GetBytes(salt = new byte[SaltSize]);
var pbkdf2 = new Rfc2898DeriveBytes(password, salt, iterations);
var hash = pbkdf2.GetBytes(HashSize);
var hashBytes = new byte[SaltSize + HashSize];
Array.Copy(salt, 0, hashBytes, 0, SaltSize);
Array.Copy(hash, 0, hashBytes, SaltSize, HashSize);
var base64Hash = Convert.ToBase64String(hashBytes);
return string.Format("$MYHASH$V1${0}${1}", iterations, base64Hash);
}
Then, when I do the Login, I prompt the user's for a password, hash it using the same function, then get the user's record from the DB and compare it using this:
public static bool Verify(string password, string hashedPassword)
{
if (!IsHashSupported(hashedPassword))
{
throw new NotSupportedException("The hashtype is not supported");
}
var splittedHashString = hashedPassword.Replace("$MYHASH$V1$", "").Split('$');
var iterations = int.Parse(splittedHashString[0]);
var base64Hash = splittedHashString[1];
var hashBytes = Convert.FromBase64String(base64Hash);
var salt = new byte[SaltSize];
Array.Copy(hashBytes, 0, salt, 0, SaltSize);
var pbkdf2 = new Rfc2898DeriveBytes(password, salt, iterations);
byte[] hash = pbkdf2.GetBytes(HashSize);
for (var i = 0; i < HashSize; i++)
{
if (hashBytes[i + SaltSize] != hash[i])
{
return false;
}
}
return true;
}
When I try this in a console app it works fine. The hashed password is verified against what I type in.
When I retrieve the password from the DB and compare it using Verify it fails.
Anyone know what's wrong, or have a better way?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You shouldn’t use a hash value because:
0) you can’t recover a forgotten password if it’s represented by a hash value because a hash can’t be reversed.
1) there’s a possibility that someone could enter a different value that can produce the same hash result.
".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
|
|
|
|
|
You're a cruel man, John!
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OK, so what other options are there?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I'm hoping John's post was meant to be a joke.
What you're doing at the moment is the correct way to store passwords.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
(I can't believe I have to add a smiley to a post like this on a dev message board, especially when everyone knows i'm a smart-ass)
(y'all are killin me with the 1-votes)
".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
|
|
|
|
|
Trouble is, "n00bs" will see those comments from a professional and well-respected developer, not realise that they're a joke, and take your advice to heart: "Don't hash passwords because John said not to".
Only us old farts who've been around long enough to know better will know that your response wasn't serious.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: well-respected developer
<looksaroundroom> Who? Where?
|
|
|
|
|
The down votes came from high-rep users (-16 points both times)...
".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
|
|
|
|
|
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
|
|
|
|