passwordbox

PasswordBox and MVVM

会有一股神秘感。 提交于 2019-12-03 05:53:12
问题 We have the following scenario: MVVM userinterface where a user can place his password (actually a PasswordBox ) Server that shall do some work Server connects to some Database that requires authentification And I already read this Question on PasswordBox in MVVM But there is no answer on how to do! Just lots over "never ever do that". What is the correct way of passing a password around? How to resolve the security issues? There is no proper way of Binding to the PasswordBox and the Password

C# - compare two SecureStrings for equality

房东的猫 提交于 2019-12-03 05:34:03
问题 I have a WPF application with two PasswordBoxes, one for the password and another for the password to be entered a second time for confirmation purposes. I was wanting to use PasswordBox.SecurePassword to get the SecureString of the password, but I need to be able to compare the contents of the two PasswordBoxes to ensure equality before I accept the password. However, two identical SecureStrings are not considered equal: var secString1 = new SecureString(); var secString2 = new SecureString(

PasswordBox and MVVM

泄露秘密 提交于 2019-12-02 19:12:07
We have the following scenario: MVVM userinterface where a user can place his password (actually a PasswordBox ) Server that shall do some work Server connects to some Database that requires authentification And I already read this Question on PasswordBox in MVVM But there is no answer on how to do! Just lots over "never ever do that". What is the correct way of passing a password around? How to resolve the security issues? There is no proper way of Binding to the PasswordBox and the Password shall not be stored somewhere, okay. So, what is the MVVM way of doing such things? Even if the

C# - compare two SecureStrings for equality

喜夏-厌秋 提交于 2019-12-02 17:55:24
I have a WPF application with two PasswordBoxes, one for the password and another for the password to be entered a second time for confirmation purposes. I was wanting to use PasswordBox.SecurePassword to get the SecureString of the password, but I need to be able to compare the contents of the two PasswordBoxes to ensure equality before I accept the password. However, two identical SecureStrings are not considered equal: var secString1 = new SecureString(); var secString2 = new SecureString(); foreach (char c in "testing") { secString1.AppendChar(c); secString2.AppendChar(c); } Assert

How can I add watermark text to a textbox in wpf?

心已入冬 提交于 2019-12-01 21:06:55
Im working on a wpf application.How I can add watermark text to the textbox and passwordbox ? <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Platforma Smart School 1.0" Height="580" Width="880" Icon="/WpfApplication4;component/Images/capturennnnnn12_256px%20%282%291.ico"> <Grid> <Grid.Background> <ImageBrush ImageSource="/WpfApplication1;component/Images/ hp-colorful-books-hd-105609.jpg" /> </Grid.Background> <Rectangle Height="334" HorizontalAlignment="Left" Margin=

Caliburn.Micro support for PasswordBox?

眉间皱痕 提交于 2019-11-30 09:24:20
The Caliburn.Micro home page at http://caliburnmicro.com makes the below claim but I am unable to make CM work with a PasswordBox control using any variation I can think of from that example. Don't see how this would work anyway since the names are not the same case. Does anyone have a CM example that does allow me to get the value of the PasswordBox? Is there a particular version of CM required? I'm running version 1.5.2 of CM. Ideally w/o using Attached Properties but if can work with CM and the only way then fine. Please no lectures on security issues as that is not an issue in my case.

PasswordBox does not assume style

北城以北 提交于 2019-11-30 03:34:59
问题 I have the following style definitions: <!-- Border --> <Style x:Key="MyControlBorder" TargetType="{x:Type Border}"> <Setter Property="BorderBrush" Value="DarkKhaki" /> <Setter Property="Background" Value="White" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="CornerRadius" Value="10" /> </Style> <!-- TextBox --> <Style x:Key="MyTextBox" TargetType="{x:Type TextBox}"> <Setter Property="Height" Value="30" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate

A good way to show password in PasswordBox

怎甘沉沦 提交于 2019-11-29 15:23:55
I wonder i some one have any good idea how to show the password in the PasswordBox. Have read that you can bind a textbox to a passwordbox but isnt it another way to do it. If you want your password to be visible you should use a textbox. The only function of a password box is to mask input. It doesn't provide extra functionality. Its also possible to switch your textbox and password box at runtime There are no any inbuilt properties to show password character in PasswordBox control. But we could do this by TextBox control to display Password in PasswordBox. For PasswordBox with show/hide

How to use PasswordBox as TextBox? [closed]

孤街浪徒 提交于 2019-11-29 13:05:19
I have a PasswordBox and I need to use this control even as a TextBox . I need to display normal text and not the typical black dots Is there a property to do this? Thanks. Joshua Van Hoesen Here is your answer: Use a Textbox When you want the text masked set TextBox.UseSystemPasswordChar = true; when you want to see the text set TextBox.UseSystemPasswordChar = false; Profit Example: private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked == true) { TextBox.UseSystemPasswordChar = true; } else { TextBox.UseSystemPasswordChar = false; } } Black dots when you

PasswordBox Binding

喜你入骨 提交于 2019-11-29 03:59:09
I'm just getting started with M-V-VM and WPF and having issues understanding some binding issues. I have a login page that has a ComboBox and a PasswordBox . The ComboBox looks like this: <ComboBox Name="comboBox1" SelectedItem="{Binding Path=Username}"> This works just fine - my values get updated everytime the SelectedItem changes on the ComboBox ! In my ViewModel I have an ICommand which uses this method to determine if the Login button is active: public bool CanLogin() { return !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password); } So my problem is I don't have the