![]() |
|
[TUT]Writing into an online file - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: [TUT]Writing into an online file (/Thread-TUT-Writing-into-an-online-file) |
[TUT]Writing into an online file - 1llusion - 02-21-2011 Hi ![]() Don't know how to call it in other words sorry ![]() you can post suggestions ![]() Ok, so today, I will teach you, how you can make a VB.NET app connect to the internet, and post some data there. We will use: => a PHP file named index.php => a simple VB.NET code => a log.txt file. It doesn't have to contain anything Setting up the web files: First of all, make a new text document. Write in the following code: PHP Code: <?php
$action = $_GET['action'];
$data = $_GET['data'];
if ($action == "delete"){
unlink("log.txt");
$new = fopen("log.txt", 'a');
fclose($new);
}
if ($action == "write"){
$open = fopen("log.txt", 'a');
fwrite($open, $data."\n");
fclose($open);
}
?>![]() Okay, save this as: index.php Now make a new text document. Just name it: log.txt upload these to a webhost. It can be free webhost ![]() Now, lets start the code. So, first we have to make a webclient, so we will do: Code: Dim wc As New WebClientYou will get error, so add: Code: Imports System.NetNow we will send the command to the php file. As you can see, there are 2 commands: "write" and "delete", we will use "write" now. So, the command will look like this: Code: http://yourhost.ext/index.php?action=write&data=![]() Now, to make this work, we have to do this: Code: wc.DownloadString("http://yourhost.ext/index.php?action=write&data=Hello World!")This will send a command to print "Hello World" into the log file ![]() Now to make it work, close the code with: Code: wc.Dispose()if you don't want the text anymore, use: Code: wc.DownloadString("http://yourhost.ext/index.php?action=delete")Thats all folks ![]() Have a great day! RE: [TUT]Writing into an online file - Coder-san - 02-22-2011 Nice Tutorial.
RE: [TUT]Writing into an online file - 1llusion - 02-22-2011 (02-22-2011, 07:48 AM)Coder-san Wrote: Nice Tutorial. Thanks
RE: [TUT]Writing into an online file - 1234hotmaster - 02-22-2011 Great guide this can be the best way to transfer data without getting rev-engineered
RE: [TUT]Writing into an online file - 1llusion - 02-22-2011 Well... not really ![]() anybody can catch the packets and ofc edit them, also since its a text file, everybody can see it... better would be to encrypt the data + use SQL database
RE: [TUT]Writing into an online file - Snipa - 02-24-2011 great tutorial mate
RE: [TUT]Writing into an online file - 1llusion - 02-24-2011 (02-24-2011, 11:17 PM)foudz32 Wrote: great tutorial mate Thanks
RE: [TUT]Writing into an online file - ShadowV - 02-25-2011 Nice tut my friend:thumbs: RE: [TUT]Writing into an online file - 1llusion - 02-26-2011 (02-25-2011, 12:59 PM)ShadowV Wrote: Nice tut my friend:thumbs: Thanks Happy you liked it
|