Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Diagnostics;
  4.  
  5. namespace Skype_to_Dialer
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             if (args.Length > 0)
  12.             {
  13.                 string checkme = args[0];
  14.                 if (checkme.CompareTo("--") == 0)
  15.                 {
  16.                     checkme = args[1];
  17.                 }
  18.                 string pattern = @"\d+";
  19.                 Match m = Regex.Match(checkme, pattern, RegexOptions.IgnoreCase);
  20.                 if (m.Success)
  21.                 {
  22.                     Console.WriteLine(m.Groups[0].Value);
  23.                     var url = "tel:" + m.Groups[0].Value;
  24.                     var psi = new ProcessStartInfo();
  25.                     psi.UseShellExecute = true;
  26.                     psi.FileName = url;
  27.                     Process.Start(psi);
  28.                 }
  29.             }
  30.         }
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement