string path = Directory.GetCurrentDirectory(); path = path + "\\Tinsoft"; ProcessStartInfo startInfo = new ProcessStartInfo(path + "\\Tinsoft Proxy Driver.exe"); startInfo.WorkingDirectory = path; //startInfo.Arguments = "hidden"; Process.Start(startInfo);
System.Net.Sockets.TcpClient clientSocket clientSocket = new System.Net.Sockets.TcpClient(); clientSocket.Connect("127.0.0.1", 888); NetworkStream serverStream = clientSocket.GetStream(); string command = ""; // Các command có sẵn ở mục dưới byte[] outStream = System.Text.Encoding.ASCII.GetBytes(command); serverStream.Write(outStream, 0, outStream.Length); serverStream.Flush(); byte[] inStream = new byte[1024]; serverStream.Read(inStream, 0, inStream.Length); string returndata = System.Text.Encoding.ASCII.GetString(inStream); returndata = returndata.Replace("\0", ""); // Giá trị trả về
get_status // Kiểm tra mode của driver là Auto hay manual start_auto // Bật chế độ auto stop_auto //Tắt auto chuyển qua Manual add_key [key]|[location_id] // Thêm key vào driver, nếu ko truyền theo location_id thì mặc định random, Ví dụ: add_key TLXXX|1 set_max_use [number] // Dùng cho chế độ auto, giới hạn tối đa số luồng trên 1 IP. VD: set_max_use 3 set_min_timeout [number] // Dùng cho chế độ auto, giới hạn timeout tối thiểu cho driver (giây) khi cấp IP. VD: set_min_timeout 120 get_proxy hoặc get_proxy random // Dùng cho chế độ auto, lấy ra 1 proxy từ driver set_thread_stop [proxy] // Dùng cho chế độ auto, Khi một luồng hoàn thành, hãy báo cho driver biết để thư viện tự tính toán kiểm soát. Ví dụ: set_thread_stop 192.168.9.5:5655 //Lưu ý: Một Thread sẽ bắt đầu bằng get_proxy và kêt thúc bằng set_thread_stop change_proxy_by_key [key] // Dùng chính cho chế độ manual, auto cũng có thể dùng được nhưng tốt nhất hãy để driver tự tính toán và đổi. change_all // Dùng chính cho chế độ manual, auto cũng có thể dùng được nhưng tốt nhất hãy để driver tự tính toán và đổi. get_list_proxies // Dùng chính cho chế độ manual, trả về danh sách proxy hiện tại. hide_form // Ẩn Form chính. show_form // Hiện Form chính. clear_keys // Xóa tất cả các keys được add vào driver