animal.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace work086
{
public class Animal
{
string color;
public string get()
{
return this.color;
}
}
}
webform1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace work086
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
work086.Animal an = new Animal();
an.get();
//运行无报错,即ok
}
}
}