473,499 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

move text box to other part of application

I have a good authentication form, which I use to login to my app. Now
I want to be able to know which user is logged in now, in order to fill
his answers in DB. In other words: I need to save & move username
(stored in text box of the authentication form) to other parts of
application. How would I do that?

TIA,
Ronen

Nov 17 '05 #1
3 1250
keep it in the session.

if this is a win app keep it in a static variable in an Auth class or
something like that.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


<ro****@tauex.tau.ac.il> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I have a good authentication form, which I use to login to my app. Now
I want to be able to know which user is logged in now, in order to fill
his answers in DB. In other words: I need to save & move username
(stored in text box of the authentication form) to other parts of
application. How would I do that?

TIA,
Ronen

Nov 17 '05 #2
This is not such agood idea, as the veriable will not keep the name
after function is through.
note: I call USR from a different form
this is the function:
private void btnOK_Click(object sender, EventArgs e)
{
DAL dal= new DAL();
if (dal.userExists(boxUserName.Text,
Int32.Parse(boxPassword.Text))==true)
{
this.DialogResult = DialogResult.OK;
}
else
MessageBox.Show("Wrong username or password. Please try again or open
new user");
USR=boxPassword.Text.ToString();.Text.ToString();
}

tried it and it wasn't useful.

P.S: USR is global variable.

Nov 17 '05 #3
hi

you do not keep the textbox, you keep the loginname.

and USR CANNOT be a global variables as there is not such a thing in C# :)

use somethign like this:

class CurrentUser
{
static string loginname="";
static public string Login{ get{ return loginname;} set { loginname=value;}}
}

then in your auth dialog, after you check that the login/password is correct
you do:

CurrentUser.Login = boxUserName.Text;

after that the login is accesible globally as CurrentUser.Login
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


<ro****@tauex.tau.ac.il> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
This is not such agood idea, as the veriable will not keep the name
after function is through.
note: I call USR from a different form
this is the function:
private void btnOK_Click(object sender, EventArgs e)
{
DAL dal= new DAL();
if (dal.userExists(boxUserName.Text,
Int32.Parse(boxPassword.Text))==true)
{
this.DialogResult = DialogResult.OK;
}
else
MessageBox.Show("Wrong username or password. Please try again or open
new user");
USR=boxPassword.Text.ToString();.Text.ToString();
}

tried it and it wasn't useful.

P.S: USR is global variable.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2801
by: Suresh Kumaran | last post by:
How do you retain the last value the user keyed in a text box? I should be able to show the values when the user runs the executable for the second time. Appreciate help. Suresh
5
12205
by: Galina | last post by:
Hello I have an Access 2000 application. The form has got a tab with 3 pages. There are several text boxes and command buttons on one page. I need to move them to another page (to free form space...
2
2043
by: Eje | last post by:
I have a webapplication on a server. One function is to build txt-files. These files should then be moved to a fixed directory on another computer in the company network. I have tried to use...
10
3058
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
4
6666
by: Pieter | last post by:
Hi, On the pc of one of my clients (W2000, Office 2003) I'm getting sometimes an exception when moving (Move) a MailItem to an Outlook-Folder: The RPC server is not available. (Exception from...
35
2974
by: Frederick Gotham | last post by:
(Before I begin, please don't suggest to me to use "std::vector" rather than actual arrays.) I understand that an object can have resources (e.g. dynamically allocated memory), and so we have to...
29
2780
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. How do I...
0
2465
by: prasenjit2007 | last post by:
I have a main form for inputing the (to/from/mesg/file) with the following code:- <html> <body> <table> <tr> <td>To:</td> <td><input type="text" name="to" size="50" ...
3
14380
by: dianaj86 | last post by:
I have multiple dropdownlists each one filled with values from a specific column in the table. Also I have multiple textboxes corresponding to dropdownlists. For example, when I select an item from...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.