If WebForm ,
a) Inherit master page, in master page use following controls.
In master page
<asp:LoginName ID="LoginName1" runat="server" />
<asp:LoginStatus ID="LoginStatus1" runat="server" />
b) If you are not inheriting master page then set user name in session & in each page get user name from session.
If Windows Application, Check solution posted by "
OriginalGriff."