How to download Youtube video on your system ?

 Hello Friends,

www.ecubicle.net

Most of the time you are really in good mood to watch your faviourite videos on youtube but you face some kind of problem with the net connection. And then you think at that time if there is any utitlity by which I can keep my faviourite videos on my pc or laptop so next time my I don’t need to afraid with net connection and bandwidth.

So if you are asp.net programmer or even not then your wish can be full fill here I am with the example how to download a youtube video on system?

 So first thing is thanks to 

which provide a web service which return url of your video.For download you tube video on your system you have to do some simple steps

 www.ecubicle.net which is “http://www.ecubicle.net/youtubedownloader.asmx you make reference in your project you can easily use it. See below fig for it. AddWebRefrence”  As

 1) Add the webservice given by   

 http://www.youtube.com/watch?v=6x1ddBJ3kiY )

 2) Then just design your screen according to your requirement current I have taken three textbox one is for video URL like (

Which you want to download and second is the path on your hard disk where you want to store download file & third is filename by which name you want your file to store. And a button with name downloads.

Screen 

 

3) The web service which we added in reference doesn’t return file it just return the original file path.

4) Now when you press download button just write following code:-

 

Protected Sub btnDownLoad_Click(ByVal sender As Object, ByVal e As EventArgs) Handles

btnDownLoad.Click 

Try

  If Me.txtPath.Text.Trim <> String.Empty AndAlso Me.txtUrl.Text.Trim <> String.Empty Then

  Dim strDownLoadUrl As String

 Dim strUrl As New Uri(Me.txtUrl.Text.Trim) ‘ url Like http://www.youtube.com/watch?v=VkCFeNeqyHk&feature=related
 Dim mtube As New net.ecubicle.www.YouTubeDownloader ‘object of web services
strDownLoadUrl = mtube.GetDownloadURL(strUrl.OriginalString) ‘ returning as string

 Dim downloadClient As New WebClient ‘create object of web client

  downloadClient.DownloadFile(strDownLoadUrl,Me.txtPath.Text & “\” & Me.txtFileName.Text) ‘ download file

 downloadClient.Dispose()

End If 

 Catch ex As Exception 

 Throw ex 

End Try

 End Sub
There is only one drawback in current code it hangs your screen till download.

 No issue that one also either you can use ajax progress bar for it or thread code to make process in background.

So here is the solution with “Threading ” which will run in background.

 Protected  Sub btnDownLoad_Click(ByVal sender As Object, ByVal e As EventArgs) Handles  btnDownLoad.Click  

 

Try

  If Me.txtPath.Text.Trim <> String.Empty AndAlso Me.txtUrl.Text.Trim <> String.Empty  Then

  Dim strUrl As New Uri(Me .txtUrl.Text.Trim) 

 strDownLoadUrl = mtube.GetDownloadURL(strUrl.OriginalString)

Dim mtube As New  net.ecubicle.www.YouTubeDownloader

 strStoragePath = Me.txtPath.Text & “\” & Me .txtFileName.Text  mythread.Start()

Dim mythread As New Threading.Thread(AddressOf  pvt_DownLoad) ‘calling thread

 End If

 Catch ex As  Exception 

 Throw  ex  End  Try End  Sub

  Private Sub  pvt_DownLoad() 

 Try Dim downloadClient As New  WebClient()

downloadClient.DownloadFile(strDownLoadUrl, strStoragePath)

 downloadClient.Dispose() 

Catch ex As Exception 

 Throw  ex

End  Try 

End  Sub

 I think you got the idea how to work on it.

 Enjoy downloading youtube videos.Enjoy weekend

God bless

Thanks

Rajat Jaiswal

 

 

How to show image logo of your site?

 Hello friends,

just see address bar first there is  “w ” icon.

You have seen this website the like

 

www.google.com, www.Yahoo.com, www.rediff.com,www.asp.net, ,www.wordpress.com

and many more provide a logo in the address bar or we can say website logo.If you don’t know how to use it you are much excited how this thing is done. First I will tell you that particular icon is called “Favicon” in technology term.

A favicon is an icon image which you can create from many Site or your own also.

Many sites provide favicon generator for example: –

 

 http://tools.dynamicdrive.com/favicon/

On this website just upload your image files and creates your favicon.

Once you done with favicon, then next thing is how to use that favicon so not to worry in that case also it is very simple just copy paste below lines and replace with your favicon icon path.

 

<link id=”Link1″ runat=”server” rel=”shortcut icon” href=”favicon.ico” type=”image/x-icon” />
 <link id=”Link2″ runat=”server” rel=”icon” href=”favicon.ico” type=”image/ico” />
In the above line just replace the path and include this in your header same like CSS.

So enjoy with your site icon.

Thanks

Rajat Jaiswal

The server returned an invalid or unrecognized response

Hello Friends,

Last one week i am fighting with the problem “Server returned an invalid or unrecognized response” when ever i want to open a web project  in asp.net 1.1.

i read lot of article but could not get proper solution how to resolve it. ever one says re-install asp.net  , re-install IIS but i don’t want to do this  ultimatly that solution is working on my machine by a miracle.

i don’t know whether it work for you people or not but it work for me.

To open solution i just  unplugged my internet connection and till now its working. when ever i want to open the solution i just unplugged internet connection it open. but when my internet connection is on its not open.

i don’t know why? it is something Illogical  thing  as a  computer guy i don’t  like illogical things but it works for me and even don’t know the reason.

if any one find the solution please let me know.

if  this works for you also then share this thing with me also.

Thanks…

enjoy opening project :))

Merge SQL files & run with Batch program utility

 

Dear all,

I got a problem 2 days ago that I have to update my database with latest sps after a particular day but the problem is there is more than 20 sql files.

So either I have to run each file one by one or do some creativity. Just due to this what I did, made an applcation.

This application is exists for the merging all SQL file after a particular date and save that file with “Merge.sql” name and also it create Batch file to run and run the file on

Selected database.

I used Osql over here if you want to download code just download at

 

http://www.indiandotnet.tkThanks

Rajat

Enjoy coding