Exemple #1
0
        static void Main(string[] args)
        {
            DllHW  dll   = new DllHW();
            string value = dll.GetValue();

            if (Convert.ToBoolean(ConfigurationManager.AppSettings["WriteToDatabase"]))
            {
                HelloWorldUseAPI hwuapi = new HelloWorldUseAPI();
                hwuapi.DisplayValue(value);
            }
            else
            {
                HelloWorld hw = new HelloWorld();
                hw.DisplayValue(value);
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            DllHW  dll   = new DllHW();
            string value = dll.GetValue();

            if (Convert.ToBoolean(ConfigurationManager.AppSettings["WriteToDatabase"]))
            {
                // display value and also save the value into database table
                HelloWorldUseAPI hwuapi = new HelloWorldUseAPI();
                hwuapi.DisplayValue(value);
            }
            else
            {
                // only display value on screen
                HelloWorld hw = new HelloWorld();
                hw.DisplayValue(value);
            }
        }