Advertisement
Guest User

AUCI 1.1

a guest
Jun 25th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.76 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Diagnostics;
  4. using System.Globalization;
  5. using System.Web;
  6.  
  7. namespace AUCI
  8. {
  9.     class Program
  10.     {
  11.           public static bool debug = false;
  12.         static string ConvertToPunycode(string domain)
  13.         {
  14.             try
  15.             {
  16.                      domain = System.Web.HttpUtility.UrlDecode(domain);
  17.                 Uri uri = new Uri(domain);
  18.                 IdnMapping p = new IdnMapping();
  19.                 string newHost = p.GetAscii(uri.DnsSafeHost);
  20.                 domain=domain.Replace(uri.Host,newHost);
  21.                 return domain;
  22.             }
  23.             catch (Exception ex) { }
  24.             return domain;
  25.         }
  26.  
  27.         static void Main(string[] args)
  28.         {
  29.               if (args.Length == 0)
  30.               {
  31.                   ShowHelp();
  32.               }
  33.               else
  34.               {
  35.                   string exe = System.Reflection.Assembly.GetEntryAssembly().Location;
  36.                   exe = exe.Substring(0, exe.LastIndexOf("\\"));
  37.                   exe += "\\avant.exe";
  38.                   try
  39.                   {
  40.  
  41.                       string argstring = "";
  42.                       for (int i = 0; i < args.Length; i++)
  43.                       {
  44.                           if (args[i] != "-url")
  45.                           {
  46.                               argstring += ConvertToPunycode(args[i]);
  47.                               if (i < args.Length - 1)
  48.                                   argstring += " ";
  49.                           }
  50.                       }
  51.  
  52.                       if (debug)
  53.                       {
  54.                           Console.WriteLine(exe + " " + argstring);
  55.                           Console.ReadLine();
  56.                       }
  57.                       Process proc = new Process();
  58.                       proc.StartInfo.FileName = exe;
  59.                       proc.StartInfo.Arguments = argstring;
  60.                       proc.Start();
  61.                   }
  62.                   catch (Exception ex)
  63.                   {
  64.                   }
  65.               }
  66.         }
  67.  
  68.           public static void ShowHelp()
  69.           {
  70.               Console.WriteLine("AUCI Version 1.1\nhttp://forum.avantbrowser.com/viewtopic.php?f=58&t=32790");
  71.               Console.ReadLine();
  72.           }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement