• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Class1类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Class1的典型用法代码示例。如果您正苦于以下问题:C# Class1类的具体用法?C# Class1怎么用?C# Class1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Class1类属于命名空间,在下文中一共展示了Class1类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Main

    public static void Main() {

        Class1 obj1=new Class1();
        CheckReturnedInt(obj1.F1("obj1"), 1);
        CheckReturnedString(obj1.F2("obj1"), "String returned from Class1.F2:obj1");
        CheckReturnedString(obj1.NonVirtualFunc(11), "String returned from Class1.NonVirtualFunc:11");
        Console.WriteLine("");

        Class2 obj2=new Class2();
        CheckReturnedInt(obj2.F1("obj2"), 2);
        CheckReturnedString(obj2.F2("obj2"), "String returned from Class2.F2:obj2");
        CheckReturnedString(obj2.NonVirtualFunc(15), "String returned from Class2.NonVirtualFunc:30");
        Console.WriteLine("");

        I1 itf;

        itf = obj1;
        CheckReturnedInt(itf.F1("itf is now obj1"), 1);
        CheckReturnedString(itf.F2("itf is now obj1"), "String returned from Class1.F2:itf is now obj1");        
        Console.WriteLine("");

        itf = obj2;
        CheckReturnedInt(itf.F1("itf is now obj2"), 2);
        CheckReturnedString(itf.F2("itf is now obj2"), "String returned from Class2.F2:itf is now obj2");
        Console.WriteLine("");

        if (failed) {
             System.Environment.ExitCode = 1;
        }
        else {
             System.Environment.ExitCode = 0;
        }
    }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:33,代码来源:interface_dispatch.cs


示例2: BindRemainder

    private void BindRemainder()
    {
        try
        {
            ObjBal = new Class1();
            ObjDataSet = new DataSet();

            ObjBal.ScreenInd = Master123.GetRemainder;
            ObjDataSet = (DataSet)ObjBal.fnGetData();
            if (ObjDataSet.Tables[0] != null)
            {
                if (ObjDataSet.Tables[0].Rows.Count > 0)
                {

                    //gvRemainders.Visible = false;
                    gvRemainders.DataSource = ObjDataSet.Tables[0];
                    gvRemainders.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:25,代码来源:frmRemainder.aspx.cs


示例3: btnAdd_Click

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        objBal = new Class1();
        try
        {
            int id = Convert.ToInt32(Session["UserID"]);
            objBal = new Class1();
            objBal.AdminRemainder = txtHotelPolicy.Text;

            objBal.ScreenInd = Master123.InsertHotelPolicy;
            objBal.id = id;

            if (objBal.fnInsertRecord() == true)
            {
                lblmsg.Text = "You have Sucessfully Saved  Your Policy";
                txtHotelPolicy.Text = "";
                BindAdminRemainder();

            }
            else
            {
                lblmsg.Text = "You can not to be saved your details";
            }
        }
        catch (Exception ex)
        {

        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:29,代码来源:HotelPolicy.aspx.cs


示例4: Main

 static void Main(string[] args)
 {
     Class1 target = new Class1();
     target.sampleEvent += new SampleEventHandler(target.handler);
     target.sampleEvent(target , EventArgs.Empty);
     target.sampleEvent(null   , EventArgs.Empty);
 }
开发者ID:basyura,项目名称:cs_sample,代码行数:7,代码来源:sample037_event.cs


示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Class1 x = new Class1();
        x.connect();

          if(!IsPostBack)

          {
          string q = "select * from Polls";

          DataTable dt = x.display(q);

          gv1.DataSource = dt;
          gv1.DataBind();

            if (Request.QueryString["iid"] != null)
            {
                string id= Request.QueryString["iid"].ToString();

                string s = "delete from polls where id_poll=" + id;

                x.allquery(s);

                Response.Redirect("deletepoll.aspx");
            }

        }
    }
开发者ID:milincjoshi,项目名称:Career_Guidance_System,代码行数:28,代码来源:Deletepoll.aspx.cs


示例6: DataTemplate_Should_Match_Data_Of_Type

        public void DataTemplate_Should_Match_Data_Of_Type()
        {
            var target = new DataTemplate { DataType = typeof(Class1) };
            var data = new Class1();

            Assert.True(target.Match(data));
        }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:7,代码来源:DataTemplateTests.cs


示例7: bt1_Click

    protected void bt1_Click(object sender, EventArgs e)
    {
        Class1 x = new Class1();
        x.connect();
        string at = "select max(Id_institute) from Institutemaster ";
        int ff = x.autoincrement(at);

        string varidpol = ff.ToString();

        string varname=txtname.Text;
        string varadd=txtaddress.Text;
        string varcity=txtcity.Text;
        string varstate=txtstate.Text;
        string varcountry=ddlcountry.SelectedItem.ToString();
        string varabout=txtabout.Text;
        string varaff=txtaffiliated.Text;
        string varcat=ddlcategory.SelectedItem.ToString();
        string varsub = ddlsub.SelectedItem.ToString();
        string varwebsite=txtwebsite.Text;
        string varemail=txtemail.Text;
        string varpass= txtpassword.Text;
        string varhelp=txthelp.Text;
        string varapp = txtapp.Text;

        string q = "insert into Institutemaster(Id_institute,Name,Address,City,State,Country,About,Affiliated,Category,Subcategory,Website,Email,Password,Helplineno,Approved) values("+ varidpol +",'"+varname +"','"+varadd +"','"+varcity +"','"+varstate +"','"+varcountry +"','"+varabout +"','"+varaff +"','"+varcat +"','"+varsub +"','"+varwebsite +"','"+varemail +"','"+varpass +"',"+varhelp+",'"+varapp +"')";
         x.allquery(q);
    }
开发者ID:milincjoshi,项目名称:Career_Guidance_System,代码行数:27,代码来源:registration.aspx.cs


示例8: Validate

    public static string Validate(string uname,string pwd)
    {
        try
        {
            if (uname == null && pwd == null)
                return "fail";
            Class1 cn = new Class1();
            DataSet ds = new DataSet();
            ds = cn.getdata("select * from Login_mst where User_Name='" + uname + "' and User_Pass='" + pwd + "'");
            if (ds.Tables[0].Rows.Count == 1)
            {
                HttpContext.Current.Session["username"] = uname;
                return "success";
            }
            else
            {
                return "fail";
            }
        }
        catch (Exception validate)
        {
            return "fail";

        }
    }
开发者ID:nikunjness,项目名称:cloudOS,代码行数:25,代码来源:signin.aspx.cs


示例9: Later_Styles_Should_Override_Earlier

        public void Later_Styles_Should_Override_Earlier()
        {
            Styles styles = new Styles
            {
                new Style(x => x.OfType<Class1>().Class("foo"))
                {
                    Setters = new[]
                    {
                        new Setter(Class1.FooProperty, "Foo"),
                    },
                },

                new Style(x => x.OfType<Class1>().Class("foo"))
                {
                    Setters = new[]
                    {
                        new Setter(Class1.FooProperty, "Bar"),
                    },
                }
            };

            var target = new Class1();

            List<string> values = new List<string>();
            target.GetObservable(Class1.FooProperty).Subscribe(x => values.Add(x));

            styles.Attach(target);
            target.Classes.Add("foo");
            target.Classes.Remove("foo");

            Assert.Equal(new[] { "foodefault", "Foo", "Bar", "foodefault" }, values);
        }
开发者ID:Scellow,项目名称:Perspex,代码行数:32,代码来源:StyleTests.cs


示例10: test1

        public void test1()
        {
            var class1 = new Class1();
            var duplicate = class1.Duplicate();

            AssertNotNull(duplicate);
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:7,代码来源:TestMemberwiseClone.cs


示例11: Func2

        public void Func2()
        {
            object[] myObjects = new object[6];
            myObjects[0] = new Class1();
            myObjects[1] = new Class2();
            myObjects[2] = "hello";
            myObjects[3] = 123;
            myObjects[4] = 123.4;
            myObjects[5] = null;

            for (int i = 0; i < myObjects.Length; ++i)
            {
                try
                {
                    string s = (string)myObjects[i];
                    if (s != null)
                    {
                        // 1. conter
                        // dfaf
                        // dfafa
                        //afdfs
                        // 1.fafddaf
                    }
                    else
                    {

                    }
                }
                catch
                {
                }

            }
        }
开发者ID:hanoKim,项目名称:Effective,代码行数:34,代码来源:1_Cast.cs


示例12: AddMultipleRelations

        public void AddMultipleRelations()
        {
            var class1 = new Class1().Modl();
            class1.MultipleRelation.Add(new Class2());
            class1.MultipleRelation.Add(new Class2());
            class1.Save();
            foreach (var class2 in class1.MultipleRelation)
                class2.Save();

            Assert.Equal(2, class1.MultipleRelation.Count());
            Assert.Equal(class1.Id(), class1.MultipleRelation.First().SingleRelation.Id);
            Assert.Equal(class1.Id(), class1.MultipleRelation.First().SingleRelation.Val.Id());

            var loadedClass1 = Modl<Class1>.Get(class1.Id());
            Assert.Equal(2, loadedClass1.MultipleRelation.Count());
            Assert.Equal(loadedClass1.Id(), loadedClass1.MultipleRelation.First().SingleRelation.Id);
            Assert.Equal(loadedClass1.Id(), loadedClass1.MultipleRelation.First().SingleRelation.Val.Id());

            foreach (var class2 in class1.MultipleRelation)
            {
                var loadedClass2 = Modl<Class2>.Get(class2.Id());
                Assert.NotNull(loadedClass2.SingleRelation.Val);
                Assert.Equal(2, loadedClass2.SingleRelation.Val.MultipleRelation.Count());
                Assert.True(loadedClass2.SingleRelation.Val.MultipleRelation.Any(x => x.Id() == loadedClass2.Id()));
            }
        }
开发者ID:bazer,项目名称:Modl,代码行数:26,代码来源:RelationsTest.cs


示例13: btnUpdate_Click

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            btnUpdate.Visible = false;
            btnCancel.Visible = false;
            int id = Convert.ToInt32(lblid.Text);
            objBal = new Class1();
            objBal.ScreenInd = Master123.UpdateAdminMarkUp;
            objBal.Modifyby = Convert.ToInt32(Session["UserID"]);
            objBal.id = id;
            objBal.Type = ddltype.SelectedItem.Text;
            objBal.MarkupAmount = txtAmount.Text;
            if (objBal.fnUpdateRecord() == true)
            {
                lblmsg.Text = "You have Sucessfully Updated Your Record";

                txtAmount.Text = "";
                ddlAddSubtract.ClearSelection();
                ddltype.ClearSelection();
                BindAdminMarkUp();
                btnUpdate.Visible = false;
                btnCancel.Visible = false;
                Button1.Visible = true;

            }

        }
        catch (Exception ex)
        {

        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:33,代码来源:AdminDBMarkUp.aspx.cs


示例14: btnAdd_Click

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            objBal = new Class1();
            objBal.ScreenInd = Master123.InsertAdminMarkup;
            objBal.Type = ddltype.SelectedItem.Text;
            objBal.MarkupAmount = txtAmount.Text;
            objBal.AddSubtract = ddlAddSubtract.SelectedItem.ToString();
            objBal.Role = Session["Role"].ToString();
            if (objBal.fnInsertRecord() == true)
            {
                lblmsg.Text = "You have Sucessfully Saved  Your Notices";
                txtAmount.Text = "";
                ddltype.ClearSelection();
                BindAdminMarkUp();

            }
            else
            {
                lblmsg.Text = "You can not to be saved your details";
            }

        }
        catch
        {

        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:29,代码来源:AdminDBMarkUp.aspx.cs


示例15: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     Class1 c = new Class1();
     ProductDataConsolidator obj = new ProductDataConsolidator();
     Gridview1.DataSource = ProductDataConsolidator.Get();
     Gridview1.DataBind();
 }
开发者ID:Monika2009,项目名称:RefactorME,代码行数:7,代码来源:Default.aspx.cs


示例16: Main

 static void Main(string[] args)
 {
     Class1 main = new Class1();
     main.startEvent(main , EventArgs.Empty);
     main.process();
     main.endEvent(main , EventArgs.Empty);
 }
开发者ID:basyura,项目名称:cs_sample,代码行数:7,代码来源:sample038_event.cs


示例17: b1_Click

    protected void b1_Click(object sender, EventArgs e)
    {
        Class1 X = new Class1();
        X.connect();

        string at = "select max(id_feedback) from feedback ";
        int ff = X.autoincrement(at);

        string msg = "name is "+ t1.Text + "E-mail is" +t2.Text + "Phone-no is"+t3.Text + "Message is"+t4.Text;
        string w = "insert into feedback values('"+ff+"','"+t1.Text+"','"+t2.Text+"','"+t3.Text+"','"+t4.Text+"')";

        int n= X.allquery(w);

        if (Send(SQLFix("[email protected]"), SQLFix("FORGET PASSWORD "), SQLFix(msg)))
        {
            abcxyz.Text = "Your inquiry has been succesfully sent";
            abcxyz.Visible = true;

        }
        else
        {
            abcxyz.Text  = "Problem with Sending Email , Try after some time";
            abcxyz.Visible   = true;
        }
    }
开发者ID:milincjoshi,项目名称:Career_Guidance_System,代码行数:25,代码来源:contactus.aspx.cs


示例18: btnAdd_Click

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        objBal = new Class1();
        try
        {
            int id = Convert.ToInt32(Session["UserID"]);
            objBal = new Class1();
            objBal.Role= txtRole.Text;

            objBal.ScreenInd = Master123.InsertRole;
            objBal.Createdby= id;

            if (objBal.fnInsertRecord() == true)
            {
                lblmsg.Text = "You have Sucessfully Saved  Your Notices";
                BindRole();
                txtRole.Text = "";

            }
            else
            {
                lblmsg.Text = "You can not to be saved your details";
            }
        }
        catch (Exception ex)
        {

        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:29,代码来源:RoleMaster.aspx.cs


示例19: BindCheckBalance

    private void BindCheckBalance()
    {
        try
        {
            objBal = new Class1();
            objDataset = new DataSet();
            //int id = Convert.ToInt32(Session["UserID"]);
           // int id = Convert.ToInt32(Session["Role"]);
            objBal.id = 4;

            objBal.ScreenInd = Master123.GetCheckBalance;
            objDataset = (DataSet)objBal.fnGetData();
            if (objDataset.Tables[0] != null)
            {
                if (objDataset.Tables[0].Rows.Count > 0)
                {

                    //gvRemainders.Visible = false;

                    gvRemainders.DataSource = objDataset.Tables[0];
                    gvRemainders.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
开发者ID:srisai339,项目名称:LoveJourney_Working,代码行数:29,代码来源:CheckBalance.aspx.cs


示例20: Button1_Click

 protected void Button1_Click(object sender, EventArgs e)
 {
     Class1 class1 = new Class1();
     SqlConnection con = new SqlConnection(class1.conn);
     con.Open();
     SqlCommand com = new SqlCommand("select uid, upwd, uname from users where uid='" + Convert.ToString(TextBox1.Text)+"'", con);
     SqlDataReader sdr;
     sdr = com.ExecuteReader();
     if (sdr.Read() != true)
     {
         Label1.Visible = true;
         Label1.Text = "User Name not found";
         con.Close();
     }
     else
     {
         if (sdr[1].ToString().CompareTo(Convert.ToString(TextBox2.Text)) != 0)
         {
             Label1.Visible = true;
             Label1.Text = "User Name and Password do not match";
             con.Close();
         }
         else
         {
             Session ["home"] = sdr[0].ToString();
             Response.Redirect("Home1.aspx");
             con.Close();
         }
     }
 }
开发者ID:santrasanchita13,项目名称:screenshot-hacker,代码行数:30,代码来源:Login.aspx.cs



注:本文中的Class1类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Class2类代码示例发布时间:2022-05-24
下一篇:
C# Class类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap