コード例 #1
0
    //main method
    public static void Main(string[] args)
    {
        //creating object
        Myclass obj1 = new Myclass();

        obj1.show();
    }
コード例 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            btnstart.IsEnabled = false;
            btnstop.IsEnabled  = true;
            Myclass.IsStop     = false;
            textBox.Text       = "";
            Myclass c     = new Myclass(textBox);
            MyData  state = new MyData {
                Message = "a", Info = "\n线程1已终止"
            };
            Thread thread1 = new Thread(c.MyMethod);

            thread1.IsBackground = true;
            thread1.Start(state);
            state = new MyData {
                Message = "b", Info = "\n线程2已终止"
            };
            Thread thread2 = new Thread(c.MyMethod);

            thread2.IsBackground = true;
            thread2.Start(state);
            state = new MyData {
                Message = "c", Info = "\n线程3已终止"
            };
            ThreadPool.QueueUserWorkItem(new WaitCallback(c.MyMethod), state);
            state = new MyData {
                Message = "d", Info = "\n线程4已终止"
            };
            ThreadPool.QueueUserWorkItem(new WaitCallback(c.MyMethod), state);
        }
コード例 #3
0
    void Start()
    {
        m_selected      = 0;
        m_imageTansform = m_avatar.GetComponent <Transform>();
        m_position      = m_imageTansform.position;
        Myclass myObject = JsonUtility.FromJson <Myclass>(dataJson);

        Debug.Log(myObject.Name);
    }
コード例 #4
0
        static void Main(string[] args)
        {
            Myclass P = new Myclass();

            Console.WriteLine(P.My(1, 6));                  //为整数类型
            Console.WriteLine(P.My(1.55f, 6.85f));          //为浮点数float类型
            Console.WriteLine(P.My(1.73d, 88.4d));          //为浮点数double类型
            //作业完成 *********************徐绿国
        }
コード例 #5
0
    static void Main()
    {
        Myclass mc = new Myclass();

        mc.PrintOut("object");

        IIfc1 ifc = mc as IIfc1;

        ifc.PrintOut("interface");
    }
コード例 #6
0
    public void Run()
    {
        Myclass obj = new Myclass();

        obj.LNRun(Callback);

        SomeMethodPtr ptr = new SomeMethodPtr(SomeMethod);

        //ptr.Invoke();
    }
コード例 #7
0
    public static void Main(string[] args)
    {
        Myclass m = new Myclass();

        Console.WriteLine(m.someProp);
        ChangeValue(m);
        Console.WriteLine(m.someProp);
        SetToNull(ref m);
        Console.WriteLine(m.someProp);
        Console.ReadKey();
    }
コード例 #8
0
    public static void Main(string[] args)
    {
        Myclass m = new Myclass();

        SetToNull(ref m);
        if (m == null)
        {
            Console.WriteLine("NULL!");
        }
        Console.ReadKey();
    }
コード例 #9
0
    static void Main()
    {
        Myclass ob = new Myclass();

        ob.SetAlpha(-99);
        ob.SetBeta(19);
        Console.WriteLine(ob.GetAlpha());
        Console.WriteLine(ob.GetBeta());
        ob.ganma = 10;
        Console.WriteLine(ob.ganma);
    }
コード例 #10
0
ファイル: Login.aspx.cs プロジェクト: KeshavPatil/vedanta
    protected void login_Click(object sender, EventArgs e)
    {
        mc = new Myclass();
        DataTable dt = new DataTable();
        dt = mc.checkpass(userid.Text, pass.Text);
        if (dt.Rows.Count != 0)
        {
            //StringBuilder mroles = new StringBuilder();
            Session["UserID"] = userid.Text;
            if (userid.Text == "Tushar")
            {

                Session["D_B"] = '0';
                //mroles.Append("User");
                //Session["Role"] = "User";
                //Response.Write(mroles.ToString());
                //FormsAuthenticationTicket fat = new FormsAuthenticationTicket(1, userid.Text, DateTime.Now, DateTime.Now.AddMinutes(20), false, "User", FormsAuthentication.FormsCookiePath);
                //Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(fat)));
                // FormsAuthentication.RedirectFromLoginPage(userid.Text,false);
                FormsAuthentication.RedirectFromLoginPage(userid.Text, createPersistentCookie: true);
            }
            else if (userid.Text == "HOD")
            {
                Session["D_B"] = '1';
                FormsAuthentication.RedirectFromLoginPage(userid.Text, createPersistentCookie: true);
            }
            else if (userid.Text == "Admin")
            {
                Session["D_B"] = '2';
                FormsAuthentication.RedirectFromLoginPage(userid.Text, createPersistentCookie: true);
            }
            else if (userid.Text == "Sodexo")
            {
                Session["D_B"] = '3';
                FormsAuthentication.RedirectFromLoginPage(userid.Text, createPersistentCookie: true);
            }

        }
        else
        {
            string message = "Incorrect Username or password";
            string script = "window.onload = function(){ alert('";
            script += message;
            script += "')};";

            ClientScript.RegisterStartupScript(this.GetType(), "Write", script, true);

        }
    }
コード例 #11
0
    private IEnumerator GetPaths()
    {
        string getUrl = "http://192.168.43.88:5000/";

        Debug.Log("getting name from " + getUrl);

        WWW getName = new WWW(getUrl);

        while (!getName.isDone)
        {
            Debug.Log("Download image on progress" + getName.progress);
            yield return(null);
        }

        if (!string.IsNullOrEmpty(getName.error))
        {
            Debug.Log("Download failed");
        }
        else
        {
            Debug.Log("Teeeext: " + getName.text);
            Myclass wrapper = JsonUtility.FromJson <Myclass>(getName.text);
            Debug.Log(wrapper.data.Length);
            files = wrapper.data;
            Debug.Log("Imgs in path: " + files + "lenght" + files.Length);

            foreach (string file in files)
            {
                Debug.Log("File Name: " + file);
            }

            for (int j = 0; j < 4; j++)
            {
                for (int i = 0; i < 6; i++)
                {
                    int number = j * 6 + i;
                    if (number >= files.Length)
                    {
                        break;
                    }
                    GameObject img = Instantiate(image, transform);
                    img.transform.Translate(j * 0.06F + 0.02F, 0, i * 0.055F);
                    Debug.Log("=====fig n " + number + "j:" + j + "i:" + i);
                    StartCoroutine(loadSpriteImageFromUrl(files[number], img));
                }
            }
        }
    }
コード例 #12
0
ファイル: Program.cs プロジェクト: ehershey/development
        static void Main(string[] args)
        {
            Myclass mc = new Myclass();

            foreach (int i in mc.GetAll())
            {
                Console.WriteLine(i);
            }


            foreach (int i in mc.GetOdd())
            {
                Console.WriteLine(i);
            }

        }
コード例 #13
0
    /// <summary>
    ///  basic collection
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        var myclassEnumerator = new Myclass().GetEnumerator();

        ArrayList alist = new ArrayList();

        alist.Add(1);
        alist.Add("two");
        alist.Add(DateTime.Now);


        //
        List <string> list = new List <string>();

        list.Add("fasdf");
    }
コード例 #14
0
ファイル: Program.cs プロジェクト: seonhui613/csharp
    static void Main()
    {
        Myclass m1 = new Myclass();

        Console.WriteLine("\n");
        Myclass m2 = new Myclass(1);

        Console.WriteLine("\n");
        Myclass m3 = new Myclass(1, 2);

        Console.WriteLine("\n");
        Myclass m4 = new Myclass(1, 2, 3);

        Console.WriteLine("\n");
        Myclass m5 = new Myclass(1, 2, 3, 4);
    }
コード例 #15
0
    public static void Main()
    {
        Myclass mc = new Myclass();
        Thread  t1 = new Thread(new ThreadStart(mc.execute));
        Thread  t2 = new Thread(new ThreadStart(mc.execute));

        t1.Start();
        t2.Start();
        t1.Join();
        t2.Join();
        for (int i = 10; i < 15; i++)
        {
            System.Console.WriteLine(i + "main");
            Thread.Sleep(500);
        }
    }
コード例 #16
0
    static void Main()
    {
        MyStrMethods objA = new MyStrMethods();
        Myclass      objB = new Myclass();
        MyClass2     objC = new MyClass2();

        Test <MyStrMethods> t1 = new Test <MyStrMethods>(objA);

        t1.ShowReverse("this tis a test.");

        Test <Myclass> t2 = new Test <Myclass>(objB);

        t2.ShowReverse("More Testing.");

        // Test<MyClass2> t3 = new Test<MyClass2>(objC);
        // t3.ShowReverse("Error!");
    }
コード例 #17
0
        static void Main(string[] args)
        {
            MyMethodPointer pointer;


            Myclass myclass = new Myclass();

            pointer  = myclass.SumOfNumber;
            pointer += myclass.SubstractionOfNumbers;
            pointer += myclass.MultiplicationOfNumber;
            pointer += myclass.DivisionOfNumber;



            pointer -= myclass.SumOfNumber;
            pointer -= myclass.SubstractionOfNumbers;


            pointer(8, 2);
        }
コード例 #18
0
	public override void OnInspectorGUI()
	{
		if ( myObject == null )
			myObject = target as Myclass;
		
		GUILayout.Label(">>>>>>>>>>>>>>>>>>");
		GUILayout.Label("Myclass Inspector");
		GUILayout.Label(">>>>>>>>>>>>>>>>>>");
		
		if ( GUILayout.Button("Change Name") )
		{
			myObject.SetName("New Name");
		}
		
		// toggle display of inspector GUI
		showDefaultInspector = GUILayout.Toggle(showDefaultInspector, "Show Default Inspector");
		if (showDefaultInspector)
			DrawDefaultInspector();
		else
			myObject.OnInspectorGUI();			
	}
コード例 #19
0
        public ActionResult Ans()
        {
            var     model = new List <Myclass>();
            Myclass ram;

            foreach (var i in db.AccountBook.ToList())
            {
                ram = new Myclass();
                //string[] talk;
                //talk = i.Remarkkk.Split('5');
                //var talk1 = "";
                //foreach (var text in talk)
                //{
                //    talk1 += text;
                //}
                //ram.Remarks = (i.Remarkkk).Substring(0,10);
                //if (i.Remarkkk.Length == 0)
                //{
                //    ram.Remarks = "邱炯達";
                //}
                //ram.Remarks = i.Remarkkk.Substring(0,4);
                ram.Money = i.Amounttt.ToString("#,000");
                ram.Date  = i.Dateee.ToString("yyyy-MM-dd hh時mm分");
                ram.Id    = i.Id;
                var 類型 = "";
                if (i.Categoryyy != 0)
                {
                    類型 = "收入";
                }
                else
                {
                    類型 = "支出";
                }
                ram.Type    = 類型.ToString();
                ram.Remarks = (i.Remarkkk.Length > 3) ? i.Remarkkk.Substring(0, 3) : "我是地雷";
                model.Add(ram);
            }
            return(View(model));
        }
コード例 #20
0
        static void Main(string[] args)
        {
            //特性实验
            Myclass t  = new Myclass();
            Type    ty = t.GetType();

            //判断是否使用了特性
            if (ty.IsDefined(typeof(MyTestAttribute), false)) //第二个参数表示要不要搜索继承链(属性和事件忽略此参数)
            {
                Console.WriteLine("该Type应用了MyTestAttribute特性");
            }
            //得到特性
            object[] arr = ty.GetCustomAttributes(true);
            foreach (var item in arr)
            {
                Console.WriteLine((item as MyTestAttribute).info);
            }


            //MethodInfo me = ty.GetMethod("fun1");
            //Console.WriteLine(me);
            Console.ReadLine();
        }
コード例 #21
0
        public void mymethod1()
        {
            Myclass myClass = new Myclass();

            myClass.mymethod2(TextBox1);
        }
コード例 #22
0
        static void Main(string[] args)
        {
            Myclass my = new Myclass();

            Console.WriteLine(my);
        }
コード例 #23
0
 public static void Main()
 {
     Myclass.Message("In Main function.");
     function1();
     Console.ReadKey();
 }
コード例 #24
0
 static void function2()
 {
     Myclass.Message("In Function 2.");
 }
コード例 #25
0
    static void Main()
    {
        Myclass mc = new Myclass();

        mc.PrintOut("object");
    }
コード例 #26
0
 static void ChangeValue(Myclass m)
 {
     m.someProp = 10;
 }
コード例 #27
0
 static void Main(string[] args)
 {
     Console.WriteLine("1st");
     Myclass.Main(args);
     Console.WriteLine("3rd");
 }
コード例 #28
0
 public void tesing()
 {
     var obj = new Myclass <MyString>();
 }
コード例 #29
0
 static void SetToNull(ref Myclass m)
 {
     m = null;
 }