Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Class1 c = new Class1();

            c.method1_class1();
            Console.WriteLine("This is private Global variable in class1:= " + c.method2_class1());
            Console.WriteLine("This is protected Global variable in class1:= " + c.method3_Class1());



            Program p = new Program();

            Console.WriteLine("This is Global variable from Program:= " + p.Global_private_prog);
            p.method1_programe();
            Console.WriteLine("This is protect variable from Program:= " + p.Global_protect_prog);
            Console.WriteLine("Access Internal access modifer:= " + p.sku);
            //Console.WriteLine(p.test_inter);


            laptop l = new laptop();

            //l.test_myinter;  internal access modifer are accessible only with the same assembly
            Console.WriteLine(l.test_public);
            l.test_return_pro();
            l.test_return_interal();
            l.test_return_private();
            l.public_method_electronics();


            Program p1 = new Program();

            p1.test_pro();
            p1.test_int();

            Class3 c1 = new Class3();

            c1.test_int();


            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public IActionResult Get()
        {
            string        uri1    = "https://www.mytek.tn/13-pc-portable?selected_filters=gamer-oui%2Ftype-ordinateur_portable&id_category=13&n=68";
            string        uri2    = "https://www.mytek.tn/13-pc-portable?selected_filters=gamer-oui%2Ftype-ordinateur_portable";
            List <laptop> laptops = new List <laptop>();
            int           i       = 1;

            HtmlAgilityPack.HtmlWeb      web = new HtmlAgilityPack.HtmlWeb();
            HtmlAgilityPack.HtmlDocument doc = web.Load(uri1);
            //string m = doc.DocumentNode.SelectNodes("//img[@class='replace-2x img-responsive'").First().Attributes[""].Value;
            //SelectNodes("//a/img")
            foreach (var item in doc.DocumentNode.SelectNodes("//a[@class='product_img_link']/img"))
            {
                string src     = item.Attributes["src"].Value;
                laptop ilaptop = new laptop();
                ilaptop.photo = src;
                ilaptop.title = doc.DocumentNode.SelectNodes("//a[@class='product-name']")[i].InnerText;
                laptops.Add(ilaptop);
                i++;
            }
            return(Ok(laptops));
        }
Ejemplo n.º 3
0
 public UserDao()
 {
     lt = new laptop();
 }
Ejemplo n.º 4
0
 public taikhoandangnhap()
 {
     lt = new laptop();
 }