예제 #1
0
 /// <summary>
 /// 更改窗体大小
 /// </summary>
 /// <param name="w"></param>
 /// <param name="h"></param>
 public static int[] formSizeRead()
 {
     lib.pIni ini   = new lib.pIni(Config.configIni);
     int[]    array = new int[2];
     try
     {
         array[0] = Int32.Parse(ini.IniReadValue("form1", "formSizeWrite-W"));
         array[1] = Int32.Parse(ini.IniReadValue("form1", "formSizeWrite-H"));
     }
     catch
     {
         array[0] = 1138;
         array[1] = 722;
     }
     return(array);
 }
예제 #2
0
        /// <summary>
        /// 获取配置中postjson
        /// </summary>
        /// <returns></returns>
        public static string postJsonUrlDataGet()
        {
            lib.pIni ini = new lib.pIni(Config.configIni);
            string   str = ini.IniReadValue("form1", "postJsonUrlDataWrite");

            str = lib.pBase64.base64ToString(str);
            return(str);
        }
예제 #3
0
        /// <summary>
        /// textboxurl 读
        /// </summary>
        /// <param name="textbox"></param>
        public static void textBoxUrlRead(TextBox textbox)
        {
            string url = "";

            lib.pIni ini = new lib.pIni(Config.configIni);
            try
            {
                url = ini.IniReadValue("form1", "textboxurl");
            }
            catch
            {
            }
            textbox.Text = url;
        }
예제 #4
0
        //----------------------------------------------------template---------------------------------------------------



        //----------------------------------------------------dataurlview-start----------------------------------------------
        /// <summary>
        /// 配置中读取dataurl显示到dataview
        /// </summary>
        /// <param name="dd"></param>
        public static void dataviewUrlDataRead(DataGridView dd)
        {
            try
            {
                lib.pIni ini = new lib.pIni(Config.configIni);
                string   str = ini.IniReadValue("form1", "dataviewUrlDataWrite");
                str           = lib.pBase64.base64ToString(str);
                object[,] obj = pJson.jsonStrToObjectArray(str, 3);
                dd.Invoke(new Action(() =>
                {
                    dd.Invalidate();
                    dd.Rows.Clear();//清理行数
                    dd.EditMode = DataGridViewEditMode.EditOnEnter;
                    if (obj.GetLength(0) > 0)
                    {
                        dd.Rows.Add(obj.GetLength(0));
                        for (int i = 0; i < obj.GetLength(0); i++)
                        {
                            dd.Rows[i].Cells[0].Value = obj[i, 0];
                            dd.Rows[i].Cells[1].Value = obj[i, 1];
                            dd.Rows[i].Cells[2].Value = obj[i, 2];
                            if (File.Exists(obj[i, 1].ToString()))
                            {
                                dd.Rows[i].Cells[3].Value = "文件";
                            }
                            else
                            {
                                dd.Rows[i].Cells[3].Value = "字符串";
                            }
                        }
                    }
                }));
            }
            catch (Exception ex)
            {
                pLogs.logs(ex.ToString());
                dd.Invalidate();
                dd.Rows.Clear();//清理行数
            }
        }
예제 #5
0
        /// <summary>
        /// 读取配置
        /// </summary>
        /// <param name="Section"></param>
        /// <param name="Key"></param>
        /// <returns></returns>
        public static string read(string Section, string Key)
        {
            pIni ini = new pIni(Config.configIni);

            return(ini.IniReadValue(Section, Key));
        }
예제 #6
0
 /// <summary>
 /// 读取httpHTML类型进行覆盖
 /// </summary>
 /// <param name="comboBox"></param>
 public static void httpHtmlTypeDataRead(ComboBox comboBox)
 {
     lib.pIni ini = new lib.pIni(Config.configIni);
     try { comboBox.Text = ini.IniReadValue("form1", "httpHtmlTypeDataWrite"); } catch { comboBox.Text = "TEXT"; }
 }