Friday, March 10, 2017

Remove the shortcut Virus from your computer or Pen-drive or any removal drive

To remove the shortcut virus fro you computer use below process.

How to Remove Shortcut Virus From Pendrive / USB Drive from computer 1. Go to Start and Search for cmd, as it appears in start menu Right Click on it and Click “Run as Administrator“ 2. Navigate to Flash Drive by typing its letter. ... 3. Type ” del *.lnk ” (without quote) in cmd window and Hit Enter on your Keyboard.

Friday, November 6, 2015

Setting Root Password for Ubuntu

Usually Root is password is disable on Ubuntu. You need to setup a password for root,then you can access root.

You can follow below procedure to enable root on Ubuntu.











 Now you are able login as root by su using this password.

 You can find below link for details.

http://manpages.ubuntu.com/manpages/precise/man1/su.1.html
http://askubuntu.com/questions/444246/why-dont-i-have-a-password-for-su-problems-with-sudo

Wednesday, March 26, 2014

how to add internal and external css ?                                                                                            
 
external css file:

 <html>
 <head>
  <link rel="stylesheet" href="filename" type="text/css" />  
 </head>
 <body>
 </body>
 </html>


 internal css:

 <html>
 <head>
  <style  type="text/css">
 body
 {
 width:950px;
 height: 30px;
 }
 </style>
 </head>
 <body>
 </body>
 </html>
How to send ajax request ??                                                                                                        

 var variable=$("#id").val();
 $.ajax({
             type: "POST",
             url: "myphp.php",
             data: "variable="+variable;        
 success: function(html){
               if(html=='true')
               {
                 alert(html);
                
               }
               else
               {
                     $("#error_id").html("Wrong username or password");
               }
             },
             beforeSend:function()
             {
                  $("#error_id").html("Loading...")
             }
         });

How to create custom Jquery plugin and use it ?                                                                                     
 .............................................................................................................................................................................
 Create simple sliderPlugin code

 (function($) {
 $.fn.sliderPlugin  = function(options) {
 options = $.extend({}, $.fn.sliderPlugin.defaults,options);
 return this.each(function() {
 $(this)
 .bind('click', function() {
 $(this).next().slideToggle(
 options.duration,
 options.complete
 );
 });

 });

 $.fn.sliderPlugin.defaults = {
 duration: 'fast',
 complete: null
 };
 };
 })(jQuery);

 Save it "jquery.sliderPlugin.js" and follow the calling procedure.
  .........................................................................................................................................................................
  (call custom plugin)

 #  html(index.html)

 <!DOCTYPE html>
 <html>
 <head>
 <title>custom plugin</title>
 <link rel="stylesheet" href="style.css" type="text/css"/>
 <script src="jquery-1.3.2.min.js" type="text/javascript"></script>
 <script src="script.js" type="text/javascript"></script>
 <script src="jquery.sliderPlugin.js" type="text/javascript"></script>
 </head>
 <body>
 <h2>Fill up form and hit submit</h2>
 <div id="content_pane">
 <h3>Information</h3>
 <p id="shower" class="pane_toggler">Lorem ipsum dolor sit amet, amet coram regis suam non coepit cenam veniebant est in lucem exitum vivit in. Maria cum unde tu bestias terras se ad te finis puellam ad suis alteri si. Manu in lucem exempli paupers coniunx.</p>

 <h3>Metadata</h3>
 <p class="pane_toggler">Lorem ipsum dolor sit amet, amet coram regis suam non coepit cenam veniebant est in lucem exitum vivit in. Maria cum unde tu bestias terras se ad te finis puellam ad suis alteri si. Manu in lucem exempli paupers coniunx2.</p>
 </div>
 </body>
 </html>
 ................................................................................................................................................................................
 #css(style.css)

 body{
 font-family:Verdana;
 font-size:13px;
 }
 h2{
 text-align:center;
 }
 #content_pane{
 width:400px;
 margin:0 auto;
 overflow:hidden;
 border:1px solid #ccc;
 border-radius:5px;
 padding:10px;
 }
 h3{
 text-align:center;
 padding:5px;
 background:#ddd;
 border:1px solid #ccc;
 cursor:pointer;
 }

 .pane_toggler{

 }
 ...............................................................................................................................................................................
 #javascript(script.js)

 $(document).ready(function () {
 $('h3').sliderPlugin({
 duration: 500,
 complete: function(){
 alert("complete");
 }
 });
 });
 .................................................................................................................................................................................
How to add custom grid view in C# ?                                                                                                      

         public void CustomGridView()
        {
            gridviewname.ColumnCount = 5;
            gridviewname.Columns[0].HeaderText = "Id";
            gridviewname.Columns[1].HeaderText = "Name";
            gridviewname.Columns[2].HeaderText = "Amount";
            gridviewname.Columns[3].HeaderText = "Expense By";
            gridviewname.Columns[4].HeaderText = "Date";
            gridviewname.Columns[0].Width = 50;
            gridviewname.Columns[1].Width = 180;
            gridviewname.Columns[2].Width = 100;
            gridviewname.Columns[3].Width = 180;
            gridviewname.Columns[4].Width = 150;
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            style.BackColor = Color.White;
            style.Font = new Font("Arial", 8, FontStyle.Bold);
            style.ForeColor = Color.Navy;
            style.Padding = new Padding(5, 2, 5, 5);
            style.SelectionBackColor = Color.LightBlue;
            gridviewname.DefaultCellStyle = style;

            DataGridViewCellStyle styleHdr = new DataGridViewCellStyle();
            styleHdr.Padding = new Padding(1, 1, 1, 1);
            styleHdr.BackColor = Color.OldLace;
            styleHdr.ForeColor = Color.Black;
            gridviewname.ColumnHeadersDefaultCellStyle = styleHdr;

            gridviewname.AllowUserToAddRows = false;
            gridviewname.AllowUserToOrderColumns = false;
            gridviewname.AllowUserToDeleteRows = false;
            gridviewname.AutoGenerateColumns = false;
            gridviewname.ReadOnly = false;
            gridviewname.Columns[0].ReadOnly = true;
            gridviewname.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
            gridviewname.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
            gridviewname.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
            gridviewname.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable;
            gridviewname.Columns[4].SortMode = DataGridViewColumnSortMode.NotSortable;

        }

//Call this Method.

CustomGridView();
How to data pass from Child Form to Parent Form ??                                                                         






 // Parent form


 public static Parent ParentRef { get; private set; }

     public Parent()
         {
            
             InitializeComponent();
             ParentRef = this;
            
         }
  
    public void datapass(string name,string result)
    {
         MessageBox.Show(name+result);
    }

 //Child form

    private void bu_send_Click(object sender, EventArgs e)
         {
             var obj_parent = Parent.ParentRef;
             obj_ot.datapass(textBox1.Text.Trim(),textBox2.Text.Trim());
             this.Close();
         }