Wednesday, October 24, 2007

Send Files to IP address in C#


 Send Files to IP address in C#
=============================

string sourceDir = @"C:\\tt";
string destIP = @"\\10.10.10.10\shared-folder-amit";
string[] sourceFiles = Directory.GetFiles(sourceDir, "*", SearchOption.AllDirectories);
foreach (string files in sourceFiles) {
  string localFile = files.Replace(sourceDir, "");
  if (!Directory.Exists(Path.GetDirectoryName(destIP + "\\" + localFile)))
    Directory.CreateDirectory(Path.GetDirectoryName(destIP + "\\" + localFile));
  File.Copy(files, destIP + "\\" + localFile, true);
}

Tuesday, October 16, 2007

Image rotate in jQuery

Image rotate in jQuery



<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<img style="transform: rotate(285.4deg);" id="myimg"  src="WOW.jpg">
<script type="text/javascript">
    jQuery(function($) {
        $(document).ready(function() {
            window.imagerotate = function () {
                $('#myimg').rotate({
                                angle:0,
                                animateTo:-360,
                                callback: imagerotate,
                                //t: current time,b: beginning value,c: change in value,d: duration
                                easing: function (x,t,b,c,d) {
                                    return c*(t/d)+b+10000;
                                }
                            });
                        };
                        setTimeout('imagerotate()', 1000);
                });
});
</script>
</body></html>