Beispiel #1
0
        /// <summary>
        /// postJson写入历史配置
        /// </summary>
        /// <param name="dd"></param>
        public static void postJsonUrlDataWrite(string text)
        {
            string str = lib.pBase64.stringToBase64(text);

            lib.pIni ini = new lib.pIni(Config.configIni);
            ini.IniWriteValue("form1", "postJsonUrlDataWrite", str);
        }
Beispiel #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);
        }
Beispiel #3
0
        /// <summary>
        /// dataurl写入历史配置
        /// </summary>
        /// <param name="dd"></param>
        public static void dataviewUrlDataWrite(DataGridView dd)
        {
            string[,] array = dataViewUrlDataToObjectArray(dd);
            string str = pJson.objectToJsonStr(array);

            str = lib.pBase64.stringToBase64(str);
            lib.pIni ini = new lib.pIni(Config.configIni);
            ini.IniWriteValue("form1", "dataviewUrlDataWrite", str);
        }
Beispiel #4
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;
        }
Beispiel #5
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);
 }
Beispiel #6
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();//清理行数
            }
        }
Beispiel #7
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));
        }
Beispiel #8
0
        /// <summary>
        /// 写入配置
        /// </summary>
        /// <param name="Section"></param>
        /// <param name="Key"></param>
        /// <param name="Value"></param>
        public static void write(string Section, string Key, string Value)
        {
            pIni ini = new pIni(Config.configIni);

            ini.IniWriteValue(Section, Key, Value);
        }
Beispiel #9
0
 //------------------------ini-------------------------------------------------
 /// <summary>
 /// http类型写入
 /// </summary>
 /// <param name="comboBox"></param>
 public static void httpTypeWrite(ComboBox comboBox)
 {
     lib.pIni ini = new lib.pIni(Config.configIni);
     ini.IniWriteValue("form1", "httpTypeWrite", comboBox.Text);
 }
Beispiel #10
0
 /// <summary>
 /// 写入窗体改变大小
 /// </summary>
 /// <param name="w"></param>
 /// <param name="h"></param>
 public static void formSizeWrite(int w, int h)
 {
     lib.pIni ini = new lib.pIni(Config.configIni);
     ini.IniWriteValue("form1", "formSizeWrite-W", w.ToString());
     ini.IniWriteValue("form1", "formSizeWrite-H", h.ToString());
 }
Beispiel #11
0
 /// <summary>
 /// textboxurl 写
 /// </summary>
 /// <param name="textbox"></param>
 /// <param name="url"></param>
 public static void textBoxUrlWrite(TextBox textbox, string url)
 {
     lib.pIni ini = new lib.pIni(Config.configIni);
     textbox.Text = url;
     ini.IniWriteValue("form1", "textboxurl", url);
 }
Beispiel #12
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"; }
 }