|
For example if I run the application on a resolution 1024*768, it should have the same appearing and size if it runs on a resolution 800*600
|
|
|
|
|
zayno wrote: it should have the same appearing and size No, it should not.
Reread the answers given, or ask for further explanation - but just restating the question is not going to change the answer.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I cannae change the laws of physics, Captain!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Not without rebooting the universe
|
|
|
|
|
I like a man who thinks big!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
... or daring Q to change them.
("asking" is not likely to work )
|
|
|
|
|
As Eddie say, no it shouldn't.
What for example is your form going to look like on my setup?
Your form designed for 1024 x 768.
My primary monitor is in Portrait mode, not landscape - my secondary is landscape.
In Portrait mode, my resolution is 1080 x 1920 which is going to skew your form design to heck and back: it's slightly wider than your original design, and two-and-a-half times as high!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Reading what everyone else has said and giving you my own two penneth of opinion I would say - add scroll bars to the form, make it resizeable and design to the most common screen resolution in your business.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I want to show a text from textbox 1 to textbox 2 with different colors in each text,here i am using Array to get text...
|
|
|
|
|
Perhaps you should ask this in the ASP.NET forum. That would seem to be the best place to get your answer.
|
|
|
|
|
Hi,
I want to edit a winform on using mode.Iwant o allow user to change the interace and add controls without modifying the source code for example add a text box to the interface without modifying the code.
modified 24-Jan-14 4:51am.
|
|
|
|
|
It's not that simple: You can add controls (or let your user add controls) very simply: just create a new control instance, and add it to the Form.Controls collection:
TextBox tb = new TextBox();
Controls.Add(tb); (You might want to set it's Size and Location properties, but that's up to you).
The problem is that that does nothing "real" to the form - it doesn't hook up any events, it doesn't use any text the user types into the textbox for anything. And it doesn't save it so it loads like that next time.
I think you need to either think a bit more about exactly what you are trying to do, or try to explain it rather better to us - because unless we have a good idea why you want to do this, we can't easily work out what it is you need help with.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I want to create an application Winform c# that allows to edit the name of a fields or add another control and without modifying the code like in Sharepoint we can add liste button without code
|
|
|
|
|
..are you merely asking permission, or is there a specific question in the pipeline?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I assume you mean that you want the end-user at run-time to be able to edit attributes of Forms and Controls, move Controls in Forms around, and add new Controls.
If that's correct, and this is a Windows Forms project:
1. To edit properties add a PropertyGrid to your Forms from the VS ToolBox 'All Windows Controls' panel.
Hide the PropertyGrid, and make it visible as needed, setting its 'SelectedObject property to a Control, or to the Form, as required.
2. Make your Controls movable by implementing the appropriate MouseDown, MouseUp, and MouseMove EventHandlers.
3. Create some UI for adding new Controls, present it to the user.
If you have specific questions about how to implement these techniques, I suggest you post them, along with code in progress, to one of the C# QA forums.
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
|
|
|
|
|
Hi All,
I want to download the most recent file from a remote SFTP. To do SFTP, I am using WinSCP.
The latest file will be decided on timestamp concatenated with FileName i.e. "myfile_20140124".
suppose I have number of files available on SFTP like
myfile_20140117.xml
myfile_20140118.xml
myfile_20140123.xml
myfile_20140124.xml
myfile_20140122.xml
myfile_20140121.xml
so I want to download the most recent file i.e. myfile_20140124.xml
I am very new to C# code Please help me.
Note: I will use all this code in SSIS 2012.
Thanks
Rahul Vairagi
-----------------------------------
www.sqlserver2005forum.blogspot.com
|
|
|
|
|
Rahul, rather than using a command line utility, you can use the inbuilt FTP classes to achieve this. The basic class you are interested in is FtpWebRequest[^]. Using this, you can connect to an FTP site and then list the files (there's a Method called WebRequestMethods.Ftp.ListDirectory that you will be invoking to get these files. Now that you have your list of files, you just need to get a copy of each filename and strip out the filenames looking for the numbers at the end (don't get fancy and try regexes, simply iterate over the characters in the name until you get to the number). Find the largest number and you've got the one you're interested in.
|
|
|
|
|
Thank you Pete for your reply !!
actually I am not using .Net framework, only using C# code in SSIS which is having many limitations.
Anyway, I got my code and its working fine.
thanks again
Thanks
Rahul Vairagi
-----------------------------------
www.sqlserver2005forum.blogspot.com
|
|
|
|
|
This excellent Code Project FTP class works very well: Simple C# FTP Class[^]
(There's a slight bug, which is documented in the comments and is easy to fix; it's a one-word change.)
|
|
|
|
|
thank you Alan
Thanks
Rahul Vairagi
-----------------------------------
www.sqlserver2005forum.blogspot.com
|
|
|
|
|
Development Environment:
Microsoft Visual Studio 2010 Ultimate,
C#,
MySql
Hi, I've create a function in mysql which accept 3 parameter to validate username and password.
DELIMITER $$
USE `generalledger`$$
DROP FUNCTION IF EXISTS `fLogin_Check`$$
CREATE DEFINER=`root`@`localhost`
FUNCTION `fLogin_Check`
(mUserName VARCHAR(50),mUserPass VARCHAR(40),mUserKey VARCHAR(40)) RETURNS INT
BEGIN
DECLARE mCount INT;
SELECT COUNT(*) INTO mCount FROM userMaster
WHERE userName = mUserName
AND AES_DECRYPT(userPass, mUserKey) = UPPER( mUserPass);
IF mCount > 0 THEN
RETURN 1;
ELSE
RETURN 0;
END IF;
END$$
DELIMITER ;
As you can see I am using AES_DECRYPT function of MySql to check password, because I've use AES_ENCRYPT for password when INSERT username and password to mysql table.
Now I need to call the function fLogin_Check in C#, which I am doing by using following class method:
public int CheckUser(string mUserName, string mPass, string mKey)
{
oCn = da.GetConnection();
int res;
if (oCn == null)
{
oCn.Open();
}
sInsProcName = "fLogin_Check";
insertcommand = new MySqlCommand(sInsProcName, oCn);
insertcommand.CommandType = CommandType.StoredProcedure;
insertcommand.Parameters.Add(new MySqlParameter("mRes", MySqlDbType.Int32, 0));
insertcommand.Parameters["mRes"].Direction = ParameterDirection.ReturnValue;
insertcommand.Parameters.Add("mUserName", MySqlDbType.VarChar, 50, mUserName);
insertcommand.Parameters.Add("mUserPass", MySqlDbType.VarChar, 40, mPass);
insertcommand.Parameters.Add("mUserKey", MySqlDbType.VarChar, 40);
insertcommand.Parameters["mUserKey"].Value = mKey;
res = insertcommand.ExecuteNonQuery();
return (res);
oCn.Close();
}
oCn is the connection abject which uses to call GetConnection method define in my DAL class and da is the object created from DAL class, use to opening and closing database connection.
Using following Global class I am storing username and password after user enter them, and then try to validating with fLogic_Check Mysql function:
public static class Globals
{
public static string userName;
public static string userPass;
public const string sKey = "AHMEDFINANCEICMAP1122";
}
sKey is the key I use to encrypt password when insert username. Now I am trying to use it in C# from Login Form when user enter Username and Password and click login button with following code:
private void btnCheck_Click(object sender, EventArgs e)
{
Globals.userName = txtUser.Text.ToString();
Globals.userPass = txtPass.Text.ToString();
if (fUser.CheckUser(Globals.userName, Globals.userPass, Globals.sKey) == 0)
{
MessageBox.Show("Invalid Username or Password.");
}
else
{
MessageBox.Show("Login Successfull");
}
}
It always return 0, means failed login. I've checked the Mysql function in MySql GUI and it works fine:
SELECT fLogin_Check("AHMED","AHMED1981","AHMEDFINANCEICMAP1122") FROM userMaster
Which successfully return 1, however it fails when calling in C#. I've also tried to access Parameter which I've comment out after failure...What am I doing wrong?
Please guide..
Ahmed
|
|
|
|
|
I do not know why your function fails, but I want to tell you that you use the wrong concept:
Passwords have to be salted and hashed, not encrypted!
|
|
|
|
|
Thanks for your reply...
I've found lots of suggestion for encrypt the password is far better then salted and hashed method..But for now that is not the matter, I am looking for solution for MySql function not working in C#. Any ideas/suggestion for that??
|
|
|
|
|
ahmed_one wrote: I've found lots of suggestion for encrypt the password is far better then salted and hashed method
Where? The consensus from every decent security expert is that salted hashed passwords are far superior to encrypted passwords.
Even if the encryption key isn't compromised, encryption tends to produce the same output given the same input, which can make it trivial to compromise a large number of user's passwords. For example: http://nakedsecurity.sophos.com/2013/11/04/anatomy-of-a-password-disaster-adobes-giant-sized-cryptographic-blunder/[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
ahmed_one wrote: I've found lots of suggestion for encrypt the password is far better then salted and hashed method Anyone who understands the difference can point out that this is incorrect.
If you store my password (encrypted), then YOU (and your boss, and everyone else in your company, and all subcontractors, and the cleaning-lady when you're AFK) will be able to decrypt the password. Next to having access to all the data you're supposed to secure, there's a huge chance that the user recycled one of his old passwords. Enough databases leaked with encrypted passwords to give us a nice and huge dictionary.
Salt and hash, or omit the password entirely; the only thing worse than no security is a FALSE sense of security.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|