Archive

Posts Tagged ‘Variable’

Global Variable 2nd method

Thursday, 15 May, 2008 3 comments

App_Code\GData.cs
using System;
using System.Data;
...
public class UserInfo
{
private static string pin;
public static string Pin
{
get { return pin; }
set { pin = value; }
}
private static string fio;
public static string Fio
{
get { return fio; }
set { fio = value; }
}
}
public class QData
{
...
public class GData
{
public static void SetUserInfoPIN(string pin)
{
UserInfo.Pin = pin;
}
public static string GetUserInfoPIN()
{
return UserInfo.Pin;
}
...
}

Read more…

Global Variable

Wednesday, 23 April, 2008 Leave a comment

declare:
public class UserInfo
{
private static string pin;
public static string Pin
{
get { return pin; }
set { pin = value; }
}
}

using:
UserInfo.Pin = userdata["pin"].ToString();
string pin = UserInfo.Pin;

Categories: ASP.NET 2.0, C# Tags: ,