A
Adam Smith
Hello. I'm wondering. is it possible to share code between a windows
forms application and an asp.net. Specifically, I'd like to do
something like:
class Demo
{
private static ArrayList al = null;
private string sType;
public Demo(string sType)
{
this.sType = sType;
if(sType == "Web")
al = Application["al"] = al;
if(al == null)
{
al = new ArrayList();
if(sType == "Web")
Application["al"] = al;
}
}
public static void initDemo(string sType)
{
if(sType == "Web")
al = Application["al"];
al.Add(3);
al.Add(5);
}
public static bool testforvalue(int n)
{
if(sType == "Web")
al = Application["al"];
return al.Contains(n);
}
}
forms application and an asp.net. Specifically, I'd like to do
something like:
class Demo
{
private static ArrayList al = null;
private string sType;
public Demo(string sType)
{
this.sType = sType;
if(sType == "Web")
al = Application["al"] = al;
if(al == null)
{
al = new ArrayList();
if(sType == "Web")
Application["al"] = al;
}
}
public static void initDemo(string sType)
{
if(sType == "Web")
al = Application["al"];
al.Add(3);
al.Add(5);
}
public static bool testforvalue(int n)
{
if(sType == "Web")
al = Application["al"];
return al.Contains(n);
}
}