All pastes #99743 Raw Edit

Someone

public text v1 · immutable
#99743 ·published 2006-07-25 16:11 UTC
rendered paste body
using FB_SDK;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Text;
using System.Windows.Forms;

namespace FreeBrowser
{
    public class ThreadHandle
    {
        // Cette chaîne sera utilisée comme paramètre
        string embout;

        // Constructeur
        public ThreadHandle(string embout)
        {
            this.embout = embout;
        }

        // Méthode boucle du thread
        public void ThreadLoop()
        {
            startEmbout(embout);
            Logger.Info("Embout "+embout+" terminé");
        }

        private static void startEmbout(string emboutName)
        {
            try
            {
                Logger.Info("Chargement de l'embout " + emboutName);
                string strPath = Application.StartupPath;
                strPath += (strPath.EndsWith(@"\") ? "" : @"\") + "libs" + @"\FBemb_" + emboutName + ".dll";

                if (File.Exists(strPath))
                {
                    object objEmbout = AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(strPath, "FreeBrowser.FB_" + emboutName);
                }
                else
                {
                    Logger.Error("Impossible de trouver l'embout " + emboutName + " : le fichier FBemb_" + emboutName + ".dll est introuvable.");
                }
            }
            catch (Exception ex)
            {
                Logger.Error("Impossible de trouver l'embout " + emboutName + " : " + ex.Message);
            }
        }

    }
}