473,624 Members | 2,575 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 1258
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.t au.ac.il> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.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(obj ect sender, EventArgs e)
{
DAL dal= new DAL();
if (dal.userExists (boxUserName.Te xt,
Int32.Parse(box Password.Text)) ==true)
{
this.DialogResu lt = DialogResult.OK ;
}
else
MessageBox.Show ("Wrong username or password. Please try again or open
new user");
USR=boxPassword .Text.ToString( );.Text.ToStrin g();
}

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.Log in = boxUserName.Tex t;

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


<ro****@tauex.t au.ac.il> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.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(obj ect sender, EventArgs e)
{
DAL dal= new DAL();
if (dal.userExists (boxUserName.Te xt,
Int32.Parse(box Password.Text)) ==true)
{
this.DialogResu lt = DialogResult.OK ;
}
else
MessageBox.Show ("Wrong username or password. Please try again or open
new user");
USR=boxPassword .Text.ToString( );.Text.ToStrin g();
}

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
2836
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
12219
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 for another control). Is it possible to move controls from one page of a tab to another, or I'll have to re-create them? If it is possible, please could you advise, how? I have tried to move one text box. It happily vanished. Thank you. Galina
2
2052
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 System.IO.File.Move but get the message "Could not find a part of the path". The path to the receiving directory is mapped. I get the same message independant of receiving computer
10
3076
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 config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
4
6679
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 HRESULT: 0x800706BA). The client has all the updates/service packs/ etc isntalled... Does anybody has any idea why this happens? Any help our hints would be really appreciated! what is that RPC server thing?
35
3014
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 copy an object properly via copy- construction rather than using memcpy. However, is it okay to move an object manually (i.e. by using memcpy or memmove)?
29
2807
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 move this project/solution from a local development xp pro computer which uses IIS/localhost, to another xp pro computer that is on a Windows 2003 server domain. I want to be able to use the Windows 2003 server IIS instead of localhost.
0
2477
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" value="pras_sandilya@rediffmail.com"></td> </tr>
3
14404
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 dropdownlistA, all the textboxes are filled with the first row values that contains that selected item and gives the number of rows containing this value……. In addition, I have 2 buttons one is Move Forward Button and the other is Move Previous…I am...
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
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 we have to send another system

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.