Your Ad Here

About Telerik

What is Telerik for a normal asp.net web designer ?
Telerik provides dll which can be added to your asp.net toolbox . These dll"s make thousands and thousands of code-behind code into one line . Not only this , it provides easy customization , modification , and better look to you content with wide range . Telerik Asp.Net ajax controls cost $999 . You can view the telerik demos , contact the support , learn about their products at their website -- www.telerik.com

I am going to post interesting snippets on and about telerik asp.net ajax . To describe this product i just have one line -- It is large , huge and provides the best .

How to Host my Asp.net Website ?

Here is a lengthy wikipedia article on Asp.net which also explains hosting.
http://en.wikipedia.org/wiki/ASP.NET

What is Asp.Net Hosting ?
Asp.Net hosting refers posting your pages on the server computer so that all people can view the pages of your website . this is what i m explaining in simple language u can google for more complex version of the detail i just gave above.

How to host a website ?
there are mainly 2 methods to host your website :
--------------------------------------First Method----------------------------------------------------
1) That your computer becomes a server PC . For that there are some requirement your pc must hve
a. ) Must be switched on 24*7 Hours
b.)Must have a static ip Address (public ip address won't do)
c.)IIS and localhost must be configured properly .
------------------------------------Second Method-----------------------------------------------------
You Can host the website using another server computer . You can have a lists of asp.net hosts over here .

Some Commands in FFMPEG

//Just Googled it man,. Google is great. Here are the commands :)

ffmpeg -i video.avi
=)Turn X images to a video sequence

ffmpeg -f image2 -i image%d.jpg video.mpg ----------------
=)This command will transform all the images from the current directory (named image1.jpg, image2.jpg, etc…) to a video file named video.mpg.
Turn a video to X images

ffmpeg -i video.mpg image%d.jpg
=)This command will generate the files named image1.jpg, image2.jpg, …

The following image formats are also availables : PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI.
Encode a video sequence for the iPpod/iPhone
=)ffmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X final_video.mp4

Explanations :

* Source : source_video.avi
* Audio codec : aac
* Audio bitrate : 128kb/s
* Video codec : mpeg4
* Video bitrate : 1200kb/s
* Video size : 320px par 180px
* Generated video : final_video.mp4

Encode video for the PSP
=)ffmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4

Explanations :

* Source : source_video.avi
* Audio codec : aac
* Audio bitrate : 32kb/s
* Video codec : xvid
* Video bitrate : 1200kb/s
* Video size : 320px par 180px
* Generated video : final_video.mp4

Extracting sound from a video, and save it as Mp3
=)ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3

Explanations :

* Source video : source_video.avi
* Audio bitrate : 192kb/s
* output format : mp3
* Generated sound : sound.mp3

Convert a wav file to Mp3
=)ffmpeg -i son_origine.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3

Convert .avi video to .mpg
=)ffmpeg -i video_origine.avi video_finale.mpg

Convert .mpg to .avi
=)ffmpeg -i video_origine.mpg video_finale.avi

Convert .avi to animated gif(uncompressed)
=)ffmpeg -i video_origine.avi gif_anime.gif

Mix a video with a sound file
=)ffmpeg -i son.wav -i video_origine.avi video_finale.mpg

Convert .avi to .flv
=)ffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flv

Convert .avi to dv
=)ffmpeg -i video_origine.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_finale.dv

Or:

=)ffmpeg -i video_origine.avi -target pal-dv video_finale.dv

Convert .avi to mpeg for dvd players
=)ffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 finale_video.mpeg

Explanations :

* target pal-dvd : Output format
* ps 2000000000 maximum size for the output file, in bits (here, 2 Gb)
* aspect 16:9 : Widescreen

Compress .avi to divx
=)ffmpeg -i video_origine.avi -s 320x240 -vcodec msmpeg4v2 video_finale.avi

Compress Ogg Theora to Mpeg dvd
=)ffmpeg -i film_sortie_cinelerra.ogm -s 720x576 -vcodec mpeg2video -acodec mp3 film_terminée.mpg

Compress .avi to SVCD mpeg2

NTSC format:
=)ffmpeg -i video_origine.avi -target ntsc-svcd video_finale.mpg

PAL format:
=)ffmpeg -i video_origine.avi -target pal-svcd video_finale.mpg

Compress .avi to VCD mpeg2

NTSC format:
=)ffmpeg -i video_origine.avi -target ntsc-vcd video_finale.mpg

PAL format:
=)ffmpeg -i video_origine.avi -target pal-vcd video_finale.mpg

Multi-pass encoding with ffmpeg
=)ffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2

FFMPEG in Csharp

What is FFMPEG ?
This is a likely question one would ask . Well FFMPEG is an application which is used to
convert one video format to another from the code behind .In the following article , I will show
you how .

What must our application contain?
User can upload file ( here- .avi) which will be saved and converted to a .flv file with a thumbnail. This is pretty Useful . It will something like youtube .

Live Demo ?
The get the live demo please visit youtube or any video sharing website OR download the code and run on loacalhost.

Source Code : DOWNLOAD THE CODE

Default.aspx contains only 2 buttons . Thats all . the button click events are shown in the Csharp file below . Download the code to get the the file ffmpeg.exe

Default.aspx.cs Code :
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Diagnostics;
// by Dotnetsnppets.co.cc
//Author Vaibhav Maheshwari
//Do Not Copy , Plz
//Protected By CopyScape ....

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{ // preview frame

Process ffmpeg; // creating process
string video;
string thumb;
video = Page.MapPath("video.flv"); // setting video input name with path
thumb = Page.MapPath("") + "\\frame.jpg"; // thumb name with path !
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i \"" + video + "\" -s 108*180 -vframes 1 -f image2 -vcodec mjpeg \"" + thumb + "\""; // arguments !
ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
ffmpeg.Start(); // start !
}
protected void convert_Click(object sender, EventArgs e)
{
Process ffmpeg; // creating process
string video;
string mpg;
video = Page.MapPath("split.avi"); // setting video input name with path
mpg = Page.MapPath("") + "\\video.flv"; // thumb name with path !
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i " + video + " -s 480*360 -deinterlace -ab 32 -r 15 -ar 22050 -ac 1 " + mpg; // arguments !
ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");

ffmpeg.Start(); // start !
ffmpeg.WaitForExit();
ffmpeg.Close();
}

}

Way 2 Sms Free Api C sharp

Here is the user friendly way 2 sms api i have made after loads of hard-work . Hope u like it

SOURCE CODE : Download the Csharp Api from HERE

From this api you can send sms from your website. As per you requirements. Using this api is simple and hence i do not think i should mention a tutorial on that ..... .

Will Keep posting , regards.....

Here is the Way 2 Sms C sharp Api :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
namespace dotnetsnippetssmsapi
{
class SmsSender
{
void send(string uid, string pwd, string no, string msg)
{
String content = "username="+uid+"&password="+pwd;
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://wwwa.way2sms.com/auth.cl");
request.KeepAlive = false;
byte[] byteArray = Encoding.UTF8.GetBytes(content);
CookieContainer cookies = new CookieContainer();
request.CookieContainer = cookies;
request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5";
request.ContentLength = byteArray.Length;
request.ContentType = "application/x-www-form-urlencoded";
request.Accept = "*/*";
request.Referer = "http://wwwg.way2sms.com//entry.jsp";
request.Method = "POST";
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
foreach (Cookie cook in response.Cookies)
{
cookies.Add(cook);
}
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);
string serverData = reader.ReadToEnd();
reader.Close();
content="HiddenAction=instantsms&login=&pass=&custid=&Action=custfrom1000000&sponserid=undefined&MobNo="
+ ToMobile + "&textArea=" + mesg
request = (HttpWebRequest)WebRequest.Create("http://wwwa.way2sms.com/FirstServletsms?custid=");
byteArray = Encoding.UTF8.GetBytes(content);
request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5";
request.ContentLength = byteArray.Length;
request.ContentType = "application/x-www-form-urlencoded";
request.Accept = "*/*";
request.CookieContainer = cookies;
request.Method = "POST";
dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
reader = new StreamReader(stream);
serverData = reader.ReadToEnd();
reader.Close();
request = (HttpWebRequest)WebRequest.Create("http://wwwa.way2sms.com/jsp/logout.jsp");
byteArray = Encoding.UTF8.GetBytes(content);
request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5";
request.ContentLength = byteArray.Length;
request.ContentType = "application/x-www-form-urlencoded";
request.Accept = "*/*";
request.CookieContainer = cookies;
request.Method = "POST";
dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
reader = new StreamReader(stream);
serverData = reader.ReadToEnd();
reader.Close();
}
catch (ArgumentException e)
{
Console.WriteLine("arg exception");
Console.Read();

}
catch (WebException e)
{
Console.WriteLine("web exception");
Console.Read();
}
catch (Exception e)
{
Console.WriteLine("exception");
Console.Read();
}
}

static void Main(string[] args)
{
SmsSender sms = new SmsSender();
sms.send("username", "password", "phno_recipient", "message");
}

}
}
/*Downloaded from dotnetsnippets.co.cc*/

Iframe sort Of Options Present in Asp.net

1 .)Well Iframe allows you to load data from any other Page or website in a part of your website . Well you can load iframe dynamically i.e there is a menu on lhs and content is to be loaded on Rhs and u dont want page to be loaded refreshed fully . you will click on the menu on the lhs the content will load. here is the website which taufgt he how to -- dyn-web.com . You Can Download the source code from here .

2 .) I have explained something known as telerik in my earlier post but would like to tell u again what exactly they are . they are set of dlls file ( for a website designer which can added to our toolbox something like ajax control toolkit . watch out for the demo over here

Click Once Deployement

CLICK ONCE DEPLOYMENT
Microsoft .Net

After the development of full fladged application, when it is time to install it on each and every PC of entire organization, it is cumbersome and hard task.

Click Once Deployment helps you to centralize the installation procedure. All you need to publish your software to IIS (Internet Information Server). Once you publish, it will automatically prepare HTML page which contains the link to install the software.

After the publish of the software, you have to open that link at client PC's browser. It will show you "Install" button, by pressing it, your software will be installed automatically from server to client.

Benefits:
(1) No experts needed for the installation. Even an end-user can install it by simply clicking on Install button. It wont ask anything during installation, so .. no confusion at all...!!!
(2) No need to prepare CD or DVD of the software. Hence stealing the software is not possible now. In addition, server authentication can be applied so the software can not be installed without proper authentication.
(3) Generally, when we install software, the files are being stored into Program Files folders. So anybody can play some trick with those files to break the security. But with Click Once Deployment, the files are stored to some Unknown Location that CAN NOT be traced by anybody. So your software files will be completely hidden, so no question of security breach or fraud or piracy.
(4) What if you have released some updates in the software. In case of normal installation, you have to again install the software to each and every PC of the organization. But.... Here in Click Once Deployment, if you will re-publish the software onto the server, the updates will be installed automatically at each and every client, when the client will execute the software (Same like in many software you will find "Updates Available" notification at start-up).

There are so many other advantages which proves the Click Once Deployment as True Developer's Choice nowadays.

If you have very big organization and regularly updating your software, then Click Once Deployment is really a co....ol choice....

Will keep posting further...

Regards...