Exemplo n.º 1
0
        /// <summary>
        /// 开始转化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConvert_Click(object sender, EventArgs e)
        {
            string picPath = txtPicPath.Text;
            string xlsPath = txtXlsPath.Text;
            string xlsName = txtXlsName.Text;
            int    spool   = System.Convert.ToInt32(txtSpool.Value);

            if (string.IsNullOrEmpty(picPath))
            {
                UiHelp.ShowWarning("请选择要转化的图片");
                return;
            }
            if (string.IsNullOrEmpty(xlsPath) || string.IsNullOrEmpty(xlsName))
            {
                UiHelp.ShowWarning("请设置转化后文件的路径和名称。");
                return;
            }

            PicIntoExcelByNpoi intoExcelByNpoi = new PicIntoExcelByNpoi(picPath, xlsPath, spool);

            try
            {
                string resultPath = intoExcelByNpoi.StartConvert(xlsName + ".xls");
                UiHelp.ShowInfo("转化完成。");

                resultPath = resultPath.Substring(0, resultPath.LastIndexOf("\\"));
                System.Diagnostics.Process.Start("Explorer.exe", resultPath);
            }
            catch (Exception ex)
            {
                UiHelp.ShowError("转化失败!" + ex.Message);
            }
        }
Exemplo n.º 2
0
    void Awake()
    {
        //Debug.Log("UiEndGamePanel");
        if (inst == null)
        {
            inst = this;
        }
        else if (inst != null)
        {
            Destroy(gameObject);
        }

        BUTTON.onClick.AddListener(HideMe);
        gameObject.SetActive(false);
    }