Wednesday 29 August 2018

regular expression in C# Windows Form







using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Text.RegularExpressions;

using System.Net.Mail;



namespace regular_expression

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }



        private void button1_Click(object sender, EventArgs e)

        {

            if (!Regex.Match(textBox1.Text,"^[a-z -']+$").Success)

            {

                MessageBox.Show("Invalid name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                textBox1.Text = " ";

            }

            else

            {

                MessageBox.Show("Data added....");

            }



     try

{      

     

  var email = new MailAddress(textBox2.Text);

}

catch (Exception)

{

        MessageBox.Show("Invalid Email", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);

        textBox2.Text = " ";



}

 



           

        }

    }

}


Tuesday 28 August 2018

Inheritance in PHP





<!doctype html>



<html>



<head>



<meta charset="utf-8">



<title>OOP-2</title>



</head>







<body>



<?PHP



class books



{

var $title; // member variable.....

var $price ; // member variable.....



function setTitle($para)

{

$this->title=$para;

} //set method.....



function getTitle()



{

echo $this->title."<br/>";

} //get method.............



//...............................................







function setPrice($para)

{

$this->price=$para;

} //set method.....







function getPrice()

{

echo $this->price."<br/>";

} //get method.............



} //class end...................



class Novel extends books

{

var $publisher;



function setPublisher($para)

{

$this->publisher=$para;

}



function getPublisher()

{

echo $this->publisher."<br>";

}





}





$obj=new Novel;

$obj->setTitle("Learn programming C#");

$obj->setPrice(500);

$obj->setPublisher("C# CORNER");



//------------------------------------------------

$obj->getTitle();

$obj->getPublisher();

$obj->getPrice();









?>



















</body>



</html>

Sunday 26 August 2018

OOP INTRODUCTION IN PHP





Source code :



<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>OOP-1</title>

</head>



<body>

<?PHP

class books

{

var $title; // member variable.....

var $price ; // member variable.....





function setTitle($para)

{

$this->title=$para;

} //set method.....



function getTitle()

{

echo $this->title."<br/>";

} //get method.............

//...............................................



function setPrice($para)

{

$this->price=$para;

} //set method.....



function getPrice()

{

echo $this->price."<br/>";

} //get method.............

} //class end...................





$physics= new books; //class instance or object........



$physics->setTitle("Physics for XII");

$physics->setPrice(150);



echo "Title of Book is : ";

$physics->getTitle();

echo  "Price of the book is ";

$physics->getPrice();





?>









</body>

</html>

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...