Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
GeneralRe: How grab all text from active window c# Pin
BillWoodruff13-Dec-13 23:40
professionalBillWoodruff13-Dec-13 23:40 
AnswerRe: How grab all text from active window c# Pin
BillWoodruff13-Dec-13 22:52
professionalBillWoodruff13-Dec-13 22:52 
GeneralRe: How grab all text from active window c# Pin
delphix513-Dec-13 23:28
delphix513-Dec-13 23:28 
QuestionEmgu Cv 2.4.9 CV.Invoke Error Pin
Smlkrmn13-Dec-13 15:42
Smlkrmn13-Dec-13 15:42 
QuestionCreate power point(ppt) from c# and add image to it Pin
delphix513-Dec-13 3:28
delphix513-Dec-13 3:28 
AnswerRe: Create power point(ppt) from c# and add image to it Pin
Richard MacCutchan13-Dec-13 3:53
mveRichard MacCutchan13-Dec-13 3:53 
AnswerRe: Create power point(ppt) from c# and add image to it Pin
Glen Childs20-Dec-13 2:40
Glen Childs20-Dec-13 2:40 
Generalscript code for mobile wireless sensor networks in c# please>>i can buy it >>if .. Pin
nass ahmad13-Dec-13 1:30
nass ahmad13-Dec-13 1:30 
GeneralRe: script code for mobile wireless sensor networks in c# please>>i can buy it >>if .. Pin
Simon_Whale13-Dec-13 1:46
Simon_Whale13-Dec-13 1:46 
GeneralRe: script code for mobile wireless sensor networks in c# please>>i can buy it >>if .. Pin
Dave Kreskowiak13-Dec-13 4:06
mveDave Kreskowiak13-Dec-13 4:06 
QuestionI am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code Pin
Member 1033787912-Dec-13 22:39
Member 1033787912-Dec-13 22:39 
QuestionRe: I am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code Pin
Richard MacCutchan12-Dec-13 23:01
mveRichard MacCutchan12-Dec-13 23:01 
AnswerRe: I am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code Pin
Member 1033787912-Dec-13 23:05
Member 1033787912-Dec-13 23:05 
GeneralRe: I am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code Pin
Marco Bertschi12-Dec-13 23:08
protectorMarco Bertschi12-Dec-13 23:08 
GeneralRe: I am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code Pin
Richard MacCutchan12-Dec-13 23:14
mveRichard MacCutchan12-Dec-13 23:14 
AnswerRe: I am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code Pin
Richard Deeming13-Dec-13 1:30
mveRichard Deeming13-Dec-13 1:30 
Questionc# dot net Pin
Janakiraman Subramanian12-Dec-13 20:44
professionalJanakiraman Subramanian12-Dec-13 20:44 
QuestionRe: c# dot net Pin
Richard MacCutchan12-Dec-13 21:24
mveRichard MacCutchan12-Dec-13 21:24 
AnswerRe: c# dot net Pin
Janakiraman Subramanian13-Dec-13 21:42
professionalJanakiraman Subramanian13-Dec-13 21:42 
GeneralRe: c# dot net Pin
Richard MacCutchan13-Dec-13 22:28
mveRichard MacCutchan13-Dec-13 22:28 
QuestionHow Change Mouse Cursor for all windows c# Pin
delphix512-Dec-13 20:36
delphix512-Dec-13 20:36 
AnswerRe: How Change Mouse Cursor for all windows c# Pin
Marco Bertschi12-Dec-13 22:22
protectorMarco Bertschi12-Dec-13 22:22 
AnswerRe: How Change Mouse Cursor for all windows c# Pin
lijizhe12-Dec-13 23:06
lijizhe12-Dec-13 23:06 
AnswerRe: How Change Mouse Cursor for all windows c# Pin
Dave Kreskowiak13-Dec-13 4:02
mveDave Kreskowiak13-Dec-13 4:02 
QuestionAn unhandled exception of type 'System.NullReferenceException' occurred Pin
Member 1037988612-Dec-13 10:45
Member 1037988612-Dec-13 10:45 
Hi I am try to get rid of an error caused by a null when I run the app it stops at:

HERE---> if (mySettings.Contains("setUserName"))<---HERE

Error Message "An unhandled exception of type 'System.NullReferenceException' occurred in Password.dll"

it doesnt show any errors prior to the button click, app loads up fine.

code below

C#
using System.IO.IsolatedStorage;

namespace Password
{
    public partial class MainPage : PhoneApplicationPage
    {
         IsolatedStorageSettings mySettings;

public void Settings()
    {
InitializeComponent();
//Initialize the settings
mySettings = IsolatedStorageSettings.ApplicationSettings;
// Display settings stored in the local storage for setUserName
if (mySettings.Contains("setUserName"))
txtUserName.Text = mySettings["setUserName"].ToString();
// Display settings stored in the local storage for setPassword
if (mySettings.Contains("setPassword"))
txtPassword.Password = mySettings["setPassword"].ToString();
}
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
             if (txtUserName.Text != "" && txtPassword.Password != "")
{
if (txtPassword.Password == txtPasswordConfirm.Password)
{
//error here
if (mySettings.Contains("setUserName"))
//error here
{
mySettings["setUserName"] = txtUserName.Text;
}
else
mySettings.Add("setUserName", txtUserName.Text);
if (mySettings.Contains("setPassword"))
{
mySettings["setPassword"] = txtPassword.Password;
}
     else
mySettings.Add("setPassword", txtPassword.Password);
mySettings.Save();
MessageBox.Show("Settings Saved Successfully");
}
else
MessageBox.Show("Passwords are not matching");
        }
    }

        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.GoBack();
        }
}}

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.