cload.cs

来自「关于医院进销存的系统」· CS 代码 · 共 55 行

CS
55
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace YYJXC
{
    class CLoad
    {
        [DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);

        private static string ReadString(string section, string key, string def, string FileName)
        {
            StringBuilder temp = new StringBuilder(1024);
            GetPrivateProfileString(section, key, def, temp, 1024, FileName);
            return temp.ToString();
        }
        private static string userId = null;
        private static string userPwd = null;
        public static string UserId
        {
            set
            {
                userId = value;
            }
            get
            {
                return userId;
            }
        }
        public static string UserPwd
        {
            set
            {
                userPwd = value;
            }
            get
            {
                return userPwd;
            }
        }
        public static string ReadServer()
        {
            return ReadString("Data", "Server", "", Application.StartupPath + "\\land.ini");
        }

        public static string ReadPwd()
        {
            return ReadString("Data", "SaPwd", "", Application.StartupPath + "\\land.ini");
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?