Пример #1
0
 public static bool OpenUrl(string browser, string args)
 {
     try
     {
         string path = getPath(browser);
         if (path != null)
         {
             Process.Start(path, args);
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         RemoteClient.LogError(ex.ToString());
         return(false);
     }
 }
Пример #2
0
        private static ImageCodecInfo GetEncoderInfo(string mimeType)
        {
            try
            {
                ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();

                for (int i = 0; i < codecs.Length; i++)
                {
                    if (codecs[i].MimeType == mimeType)
                    {
                        return(codecs[i]);
                    }
                }

                return(null);
            }
            catch (Exception e)
            {
                RemoteClient.LogError(e.ToString());
                return(null);
            }
        }