Pages

‏إظهار الرسائل ذات التسميات java script. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات java script. إظهار كافة الرسائل

j s : finder fox



                           you can add this wedget to your site and blogger
Simply insert the above code before the </body> tag of your page.


<script type="text/javascript">
var finderfoxConfig = {
    version: "1.0.0",
    key: "5eaa44a909a0b4070000012f5dee8ef1"
};
document.write(unescape('%3Cscript type="text/javascript" src="'+
('https:'==document.location.protocol?'https://ssl.':'http://')+
'finderfox.smarterfox.com/finderfox.js"%3E%3C/script%3E'));
</script>

java script: install floating digg share


Login to your Blogger account.
Go to Design > Page Elements.
Click Add A Gadget.
In Add A Gadget window, select HTML/Javascript .
Copy the code below and paste it inside the content box.

<!-- floating page sharer Start code2all.blogspot.com-->
<style>
#pageshare {position:fixed; bottom:15%; margin-left:-71px; float:left; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:#fff;padding:0 0 2px 0;z-index:10;}
#pageshare .sbutton {float:left;clear:both;margin:5px 5px 0 5px;}
.fb_share_count_top {width:48px !important;}
.fb_share_count_top, .fb_share_count_inner {-moz-border-radius:3px;-webkit-border-radius:3px;}
.FBConnectButton_Small, .FBConnectButton_RTL_Small {width:49px !important; -moz-border-radius:3px;-webkit-border-radius:3px;}
.FBConnectButton_Small .FBConnectButton_Text {padding:2px 2px 3px !important;-moz-border-radius:3px;-webkit-border-radius:3px;font-size:8px;}
</style>
<div id='pageshare'>
<div class='sbutton' id='fb'>
<a name="fb_share" type="box_count" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</div>
<div class='sbutton' id='rt'>
<script src="http://tweetmeme.com/i/scripts/button.js" type='text/javascript'></script>
</div>
<div class='sbutton' id='su'>
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script>
</div>
<div class='sbutton' id='digg'>
<script src='http://widgets.digg.com/buttons.js' type='text/javascript'></script>
<a class="DiggThisButton DiggMedium"></a>
</div>
<div class='sbutton' id='gb'>
<a class='google-buzz-button' data-button-style='normal-count' href='http://www.google.com/buzz/post' title='post on google buzz'>
<script src='http://www.google.com/buzz/api/button.js' type='text/javascript'></script>
</a></div>
<div style="clear: both;font-size: 9px;text-align:center;"><a href="http://www.bloggersentral.com/2010/07/install-floating-social-media-buttons.html">Get this</a></div>
</div>
<!-- floating page sharer End -->

 

java script : bookmark this page


<a style="font-family:Arial;font-size:14px;color:#000000;font-weight:bold;font-style:normal;text-decoration:none" href="javascript:addToFavorites('code2all', 'http://www.code2all.blogspot.com')">Bookmark this page!</a>


with my best mohamed basha

java script Email

IsEmail: Returns a Boolean if the specified Expression is a
          valid e-mail address. If Expression is null, false
          is returned.

 Parameters:
      Expression = e-mail to validate.



function IsEmail(Expression)
{
        if (Expression == null)
                return (false);

        var supported = 0;
        if (window.RegExp)
        {
                var tempStr = "a";
                var tempReg = new RegExp(tempStr);
                if (tempReg.test(tempStr)) supported = 1;
        }
        if (!supported)
                return (Expression.indexOf(".") > 2) && (Expression.indexOf("@") > 0);
        var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
        var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
        return (!r1.test(Expression) && r2.test(Expression));
}

 

java script : back ground Fade


 
 this code to make some effect to your blog or site       it's so very nice
try it now



Share/Bookmark

Java script - Scroll Background

Scroll Background
this code make scroll image background to your web site

don't forget change url of image url(resnf.JPG)  ................. Mohamed basha


this is source code to create .... system information tray icon
you can download this from here

Java script - Various times of the world

Times of different places in the world


with my best : Mohamed basha

Java script - Google search on web



If you want to have google website on you site , a very powerful search engine you can put it in your website


Here is the code in this textbox

                           with my best     :      Mohamed Basha

Shut down, restart, log off and forced log off system using c sharp

In this article, I am going to show, 
  1. How to Shut Down a machine 
  2. How to Log Off a machine
  3. How to forced log off a machine
  4. How to restart a machine using c# 
To perform our task, very first let us create a windows application project.   On form drag and drop four buttons for four different operations.  After design form will look like below 

1.gif 

Navigate to code behind of form and add reference of System.Runtime.InteropServices

Add a static extern method to Form.cs

[DllImport("user32.dll")]
public static extern int ExitWindowsEx(int operationFlag, int operationReason);

Log off  the System 

On click event of Log Off button, call ExitWindowsEX method with proper flag.  For log off  operation flag value is 0. 

private void btnLogOff_Click(object sender, EventArgs e)
{
    ExitWindowsEx(0, 0);
}

Forced Log off the System 

On click event of Forced Log Off button, call ExitWindowsEX method with proper flag.  For Forced  log off  operation flag value is 4. 

private void btnForcedLogOff_Click(object sender, EventArgs e)
{
   ExitWindowsEx(4, 0);
}

Shut Down the System

On click event of Shut down button, call ExitWindowsEX method with proper flag.  For shut down  operation flag value is 1. 

private void btnShutDown_Click(object sender, EventArgs e)
{
    ExitWindowsEx(1, 0);
}

Restart the System 

On click event of Restart button, call ExitWindowsEX method with proper flag.  For Restart  operation flag value is 2. 

private void btnRestart_Click(object sender, EventArgs e)
{
    ExitWindowsEx(2, 0);
}

Now when you run the application all system operation should be performed. 

For your reference full source code is given here 

Form.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace SystmShutDownApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
        }
        [DllImport("user32.dll")]
        public static extern int ExitWindowsEx(int operationFlag, int operationReason);
        private void btnRestart_Click(object sender, EventArgs e)
        {
              ExitWindowsEx(2, 0);
        }
        private void btnLogOff_Click(object sender, EventArgs e)
        {
            ExitWindowsEx(0, 0);
        }
        private void btnForcedLogOff_Click(object sender, EventArgs e)
        {
           ExitWindowsEx(4, 0);
        }
        private void btnShutDown_Click(object sender, EventArgs e)
        {
            ExitWindowsEx(1, 0);
        }
    }
}

Thanks for reading. I hope post was useful. Happy Coding. 

Link With in

Related Posts Plugin for WordPress, Blogger...