1
Answer

Button/textbox controlls text strings question.

Oliwer Svensson

Oliwer Svensson

14y
8.1k
1
Hello!

Im asking if there is anyway to have two text boxes and a button that tells a script to change its value or text string?

for example,

I have a C# coded SMTP-Mail, and i have 3 buttons for each smtp ports to choose between, when u click one of them a login form appears with labels ( Email, Password ), 2 TextBoxes and 2 buttons..

Is there anyway to change this fields

 Client.Credentials = new NetworkCredential("Email/Username", "Password");

with this login form and a button click?

I've looked everywhere but can't seem to find anything

all suggestions is welcome! :)
Answers (1)
1
Frogleg
NA 7.9k 33k 14y

string uName,pWord;// declare strings
//set default
uName = ("Email/Username");
pWord=("Password")
Client Credentials = new NetworkCredential(uName,pWord);
//and to change
uName =textBox1.Text;
pWord =textBox2.Text;
Client Credentials = new NetworkCredential(uName,pWord);
Accepted