web form use session cookies winform use static value ex: public class Form1: .. { public static string str1; } public class Form2: { void test() { string =Form1.str1; } }
FORM1 public string GetID { get { return Txt_ID.Text; } } FORM2 FORM2 FM = NEW FORM2(); STRING = FM。GETID
winform use static value
ex:
public class Form1: ..
{
public static string str1;
}
public class Form2:
{
void test()
{
string =Form1.str1;
}
}
public string GetID
{
get
{
return Txt_ID.Text;
}
}
FORM2
FORM2 FM = NEW FORM2();
STRING = FM。GETID