![]() |
|
[.NET] [Updated][TUT][SRC]Adfly link genrator[How to use httpwebrequests]♂♀ - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [Updated][TUT][SRC]Adfly link genrator[How to use httpwebrequests]♂♀ (/showthread.php?tid=1675883) |
[Updated][TUT][SRC]Adfly link genrator[How to use httpwebrequests]♂♀ - adiiforu - Aug 31, 2011 Introduction:- In this tutorial we are going to make a simple app which will convert our urls to Adfly links. Step1:- First we have to get the api code from adfly. Login to your adfly account. Click on the "Tools" Link. [IMG]http://girlzlist.0fees.net/?di=113148097844[/IMG] Then Click on Api Documentation [IMG]http://girlzlist.0fees.net/?di=1213148097847[/IMG] Then copy everything that's in the white space. [IMG]http://girlzlist.0fees.net/?di=1131480978415[/IMG] Step 2:- Now lets move to Visual Basic. Open Visual Basic/Studio and create a new Windows Form Application, name it anything you want. [IMG]http://girlzlist.0fees.net/?di=113148097842[/IMG] Add two text boxes and two buttons. Change the properties according to image below. [IMG]http://girlzlist.0fees.net/?di=15131480991215[/IMG] Now add this code to the form [IMG]http://girlzlist.0fees.net/?di=10131480978514[/IMG] Explanation:- Code Imports System.IOCode Dim url As String = ""This declares some string variable for later use in the project. Paste the api link you copied from step one. Remove the part after the "=" sign(http://somewebsite.com") Code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickWhat this does is first put the string from txtUrl textbox to the url variable. Then adds the url to api variable. What we have done is removed http://somewebsite.com and added our url here. Now we have created a new httpWebRequest as req with the api url. This will send a request to adfly for shortening the url with our id. Next we created a HttpWebResponse and assigned it to recieve the message from req. In the last part we create a temporary StreamReader to get the response from "res" by accessing the ResponseStream(using the getresponse propery). ReadToEnd method read everything. Atlast we have put the link we got from response into txtAdfly textbox. Code Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.ClickThis just copies the adfly link to clipboard. Further Improvements:- You can create a mass link generator where you can read all the links from a textfile and generate links. You can even make it with just one textbox and one button, even without a button. Source:-Post here and I will send you. Hope you like this tutorial. Please donate to my paypal("[email protected]") I know this is not a tutorial worth donating money but I need it. Please post in the thread * - wertyl11 - Aug 31, 2011 Yay First! Woho!! Good Tutorial! :D * - SIM-459477 - Aug 31, 2011 ya nice tutorial mate easy to understand 😉 * - adiiforu - Aug 31, 2011 Thanks guys. Good comments will motivate me to write more good tutorials. * - Fake. - Aug 31, 2011 You really should have the API key as a constant in this instance. * - adiiforu - Aug 31, 2011 (Aug 31, 2011 11:06 PM)Fake™ Wrote: You really should have the API key as a constant in this instance. Yeah, but i am using the same variable for creating the request, so... Bump after updating a few things. this msg must not be shrt. * - joker-vl - Sep 3, 2011 i love the tutorial , thanks a lot * - Wet - Sep 3, 2011 Is it just me or are the images not working? * - adiiforu - Sep 8, 2011 (Sep 3, 2011 03:28 PM)joker-vl Wrote: i love the tutorial , thanks a lot Thanks guy, I will write some more. (Sep 3, 2011 03:37 PM)Wet Wrote: Is it just me or are the images not working? They are working for me. try refreshing again and agian and agian |