public string ChkInstall(string sUnid)
        {
            Partial.wslogger.WS_Logger ws = new Partial.wslogger.WS_Logger();
            // ws.Timeout = 20000;

            try
            {
                string sRes = "";
                if (sEmail.Contains(@"cookconsulting"))
                {
                    sRes = "go";
                }
                else
                {
                    sRes = ws.ChkInstall(sUnid);
                }

                return(sRes);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
        }
        public void LogEvent(string sUnid, string sMsg, int iStatus, int iBatch)
        {
            Partial.wslogger.WS_Logger ws = new Partial.wslogger.WS_Logger();

            if (iStatus == 10000)
            {
                ws.Logger(sUnid, sCustomerName + "&" + sUserName, iStatus, iBatch);
            }
            else
            {
                ws.Logger(sUnid, sMsg, iStatus, iBatch);
            }

            ws.Dispose();
        }
        public string PackXml(string sXml, string sUnid)
        {
            string sOut = "";

            Partial.wslogger.WS_Logger ws = new Partial.wslogger.WS_Logger();
            // ws.Timeout = 20000;

            try
            {
                sOut = ws.RndCustXml(sXml, sUnid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
            return(sOut);
        }
        public void LogEvent()
        {
            Partial.wslogger.WS_Logger ws = new Partial.wslogger.WS_Logger();
            // ws.Timeout = 20000;
            IBatchNo = -1;
            try
            {
                int iBatch = int.Parse(ws.FindNextId(sUnid));
                IBatchNo = iBatch;

                ws.Logger(sUnid, sXmlDoc, 99999, iBatch);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ws.Dispose();
            }
        }
        private static void DownLoadASheet(string sAddr, string sFileName)
        {
            try
            {
                if (File.Exists(sFileName))
                {
                    FileInfo fi = new FileInfo(sFileName);
                    fi.IsReadOnly = false;
                    fi.Delete();
                }
            }
            catch { }


            RequestCachePolicy policy = new RequestCachePolicy(RequestCacheLevel.Reload);

            string address = sAddr;

            //"http://localhost/Sheets/" + sFileName + ".xls";

            System.Threading.AutoResetEvent waiter = new System.Threading.AutoResetEvent(false);
            Uri uri = new Uri(address);

            try
            {
                WebClient wc = new WebClient();
                wc.Proxy       = null;
                wc.Credentials = CredentialCache.DefaultCredentials;
                wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0)");
                wc.CachePolicy = policy;


                wc.DownloadFileCompleted   += new AsyncCompletedEventHandler(wcDownLoadDone);
                wc.DownloadDataCompleted   += new DownloadDataCompletedEventHandler(wcDownLoadDone1);
                wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wcCallbackDown);

                wc.DownloadFileAsync(uri, sFileName);
                Console.Write("DownLoading with {0} ", sFileName);
                while (wc.IsBusy)
                {
                    try
                    {
                        waiter.WaitOne(100);
                    }
                    catch { }
                }

                try
                {
                    Debug.Print("Done");
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message + " Error in Download");
                }


                Console.WriteLine("Done with {0} ", sFileName);
                // Got the File
                // Download the Files
            }

            catch (WebException ex)
            {
                if (ex.Response is WebResponse)
                {
                    HttpWebResponse            o  = (HttpWebResponse)ex.Response;
                    Partial.wslogger.WS_Logger ws = new Partial.wslogger.WS_Logger();
                    ws.Logger(sUnid, o.StatusDescription, -1, iBatchCl);
                    Console.WriteLine(o.StatusDescription + "  Download Error -" + ex.Message);
                    if (o.StatusCode == HttpStatusCode.OK)
                    {
                    }
                    else
                    {
                        Console.WriteLine(ex.Status + "  Download Error -" + ex.Message);
                        Console.ReadLine();
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                Partial.wslogger.WS_Logger ws = new Partial.wslogger.WS_Logger();
                ws.Logger(sUnid, ex.Message, -1, iBatchCl);

                Console.WriteLine(ex.Message);
                throw ex;
            }
        }