Hi all!
Today we will make a auto login bot :)
Lets start first open a new project.
Select C# Form Application.
and add Web Browser to your form.
and set WebBrowser Url to = https://www.facebook.com
I added 2 label 2 textbox and a button for login process
u can do it with setting file generate a .txt file and save email and password here and read and login account when form load.
Now: LETS WRITE SOME CODE!!!!!!!!!!!!!!!!!!!! :)))))))))))))))))
double click LOGIN button :) and go button_click event :)
First we need to find textbox id on facebook :D lets hack facebook :P
WOW i hacked facebook :P
anyways email id is "email" that was sooooo different from my imagine :D
and password id is "pass" yeap that was different :D
and Log In button id is "loginbutton" :D
and our code is
webBrowser1.Document.GetElementById("email").SetAttribute("value", textBox1.Text);
webBrowser1.Document.GetElementById("pass").SetAttribute("value", textBox2.Text);
webBrowser1.Document.GetElementById("loginbutton").InvokeMember("click");
and thats all.. We find our Elements with their ID's and we set their values and we invoke button and we are in facebook :D
and lets see how it works :)
Our codes working fine ;)
ther is my project all codes:http://yadi.sk/d/h-5rrNS8HjNzJ
Hello!
Today i will publish my ftpfilesender class with you i write this class for my project you can use it everywhere...
Test Program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace console
{
class Program
{
static void Main(string[] args)
{
FtpFileSender FileSender = new FtpFileSender();
FileSender.setFileName("File.txt");
FileSender.setUser("ftpuser");
FileSender.setPass("ftppass");
FileSender.setServer("ftp://xxx.xxx.xxx.xxx/");
//FileSender.setServer("ftp://example.com/");
FileSender.setServerPath("test/");
//FileSender.setLocalPath("c:/users/");
Console.WriteLine(FileSender.SendFile());
}
}
}
Hi :)
Today i will show you how a file transfer's a server with JAVA :)
Lets began :)
First you need that library:
import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
Apache Commons Net API
// Codes Began
package com.kacak41.FTP;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
public class FTPUploader {
FTPClient ftp = null;
public FTPUploader(String host, String user, String pwd) throws Exception{
ftp = new FTPClient();
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
int reply;
ftp.connect(host);
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
throw new Exception("Exception in connecting to FTP Server");
}
ftp.login(user, pwd);
ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.enterLocalPassiveMode();
}
public void uploadFile(String localFileFullName, String fileName, String hostDir)
throws Exception {
try(InputStream input = new FileInputStream(new File(localFileFullName))){
this.ftp.storeFile(hostDir + fileName, input);
}
}
public void disconnect(){
if (this.ftp.isConnected()) {
try {
this.ftp.logout();
this.ftp.disconnect();
} catch (IOException f) {
// do nothing as file is already saved to server
}
}
}
public static void main(String[] args) throws Exception {
System.out.println("Start");
FTPUploader ftpUploader = new FTPUploader("ftp.yoursite/yourserver.com", "ftpUser", "ftpPassword");
//FTP server path is relative. So if FTP account HOME directory is "/home/kacak41/public_html/" and you need to upload
// files to "/home/kacak41/public_html/wp-content/uploads/image2/", you should pass directory parameter as "/wp-content/uploads/image2/"
ftpUploader.uploadFile("D:\\kacak41\\images\\MyImage.png", "image.png", "/wp-content/uploads/image2/");
ftpUploader.disconnect();
System.out.println("Done");
}
}
//Codes End
With this code you can upload your files to your server or your site:)
Have a nice day...