头像

@byxiaoxie1年前

08/30
23:26
Home

C# ini配置文件读写

ini.cs 源代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace ini_config
{
    /// <summary>
    /// ini文件类
    /// </summary>
    public class IniFile
    {
        private string m_FileName;

        public string FileName
        {
            get { return m_FileName; }
            set { m_FileName = value; }
        }

        [DllImport("kernel32.dll")]
        private static extern int GetPrivateProfileInt(
            string lpAppName,
            string lpKeyName,
            int nDefault,
            string lpFileName
            );

        [DllImport("kernel32.dll")]
        private static extern int GetPrivateProfileString(
            string lpAppName,
            string lpKeyName,
            string lpDefault,
            StringBuilder lpReturnedString,
            int nSize,
            string lpFileName
            );

        [DllImport("kernel32.dll")]
        private static extern int WritePrivateProfileString(
            string lpAppName,
            string lpKeyName,
            string lpString,
            string lpFileName
            );

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="aFileName">Ini文件路径</param>
        public IniFile(string aFileName)
        {
            this.m_FileName = aFileName;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public IniFile()
        { }

        /// <summary>
        /// [扩展]读Int数值
        /// </summary>
        /// <param name="section">节</param>
        /// <param name="name">键</param>
        /// <param name="def">默认值</param>
        /// <returns></returns>
        public int ReadInt(string section, string name, int def)
        {
            return GetPrivateProfileInt(section, name, def, this.m_FileName);
        }

        /// <summary>
        /// [扩展]读取string字符串
        /// </summary>
        /// <param name="section">节</param>
        /// <param name="name">键</param>
        /// <param name="def">默认值</param>
        /// <returns></returns>
        public string ReadString(string section, string name, string def)
        {
            StringBuilder vRetSb = new StringBuilder(2048);
            GetPrivateProfileString(section, name, def, vRetSb, 2048, this.m_FileName);
            return vRetSb.ToString();
        }

        /// <summary>
        /// [扩展]写入Int数值,如果不存在 节-键,则会自动创建
        /// </summary>
        /// <param name="section">节</param>
        /// <param name="name">键</param>
        /// <param name="Ival">写入值</param>
        public void WriteInt(string section, string name, int Ival)
        {

            WritePrivateProfileString(section, name, Ival.ToString(), this.m_FileName);
        }

        /// <summary>
        /// [扩展]写入String字符串,如果不存在 节-键,则会自动创建
        /// </summary>
        /// <param name="section">节</param>
        /// <param name="name">键</param>
        /// <param name="strVal">写入值</param>
        public void WriteString(string section, string name, string strVal)
        {
            WritePrivateProfileString(section, name, strVal, this.m_FileName);
        }

        /// <summary>
        /// 删除指定的 节
        /// </summary>
        /// <param name="section"></param>
        public void DeleteSection(string section)
        {
            WritePrivateProfileString(section, null, null, this.m_FileName);
        }

        /// <summary>
        /// 删除全部 节
        /// </summary>
        public void DeleteAllSection()
        {
            WritePrivateProfileString(null, null, null, this.m_FileName);
        }

        /// <summary>
        /// 读取指定 节-键 的值
        /// </summary>
        /// <param name="section"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public string IniReadValue(string section, string name)
        {
            StringBuilder strSb = new StringBuilder(256);
            GetPrivateProfileString(section, name, "", strSb, 256, this.m_FileName);
            return strSb.ToString();
        }

        /// <summary>
        /// 写入指定值,如果不存在 节-键,则会自动创建
        /// </summary>
        /// <param name="section"></param>
        /// <param name="name"></param>
        /// <param name="value"></param>
        public void IniWriteValue(string section, string name, string value)
        {
            WritePrivateProfileString(section, name, value, this.m_FileName);
        }
    }
}

阅读全文 →

C# ini配置文件读写

头像

@byxiaoxie11月前

11/2
04:17
Home

DC Radar 搭建Hosts中转

此方法仅用与[ubuntu 14.04+ debian 8]系统
服务器:系统平台[Debian 8 x64] 测试IP:[149.28.13*.**] 主机:系统平台[Windows 7]

先更新并安装依赖库

apt update  && apt upgrade -y

apt install -y git build-essential autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts supervisor

阅读全文 →

DC Radar 搭建Hosts中转

头像

@byxiaoxie2年前

07/14
17:43
Home

PHP密码验证(源代码)

<!--
*****************
*By:TKS 17-7-13
******************
-->
<?php
if (isset($_POST['password']) && md5($_POST['password']) == md5('test')) 
{
	echo 'ByXiaoXie';
} 
else 
{
    echo <<<'EOF'
		<!DOCTYPE html>
		<html lang="en">
			<head>
				<meta charset="UTF-8">
				<title>ByXiaoXie</title>
			</head>
			<body>
				<form action='' method='post'>
				<input type='password' name="password" />
				<input type='submit' value='LOGIN'>
				</form>
			</body>
		</html>
EOF;
}
?>

9c44344dgy1fhjl8hrofkj208k02u74m PHP密码验证(源代码)     9c44344dgy1fhjl8hrofkj208k02u74m PHP密码验证(源代码)

PHP密码验证(源代码)

头像

@byxiaoxie2年前

07/16
22:03
Home

NiCoKun网站状态:已复活,请联系Line获取

求赞助本喵呀,联系站长喵扣扣:645993600 Line:byxiaoxie

本站暂无人赞助资金,因服务器不是免费的所以过期了只可以买便宜的服务器,请体谅!

希望大家可以给点资金,谢谢!ByXiaoXie


网站:Www.NiCoKun.Xyz 域名到期请联系本人获取禁止外传!

维护记录:

17-7-15:网站正在搬家中暂时无法访问,请等待几天,谢谢 ByXiaoXie !

17-7-23:网站搬家完毕可以正常访问,由于资金问题请体谅 ByXiaoXie !

17-8-16:不小心删除掉了服务器文件,已恢复正常 ByXiaoXie !

17-9-2:修复了网站加载错误等多个问题,解决了网站打开太卡的问题 ByXiaoXie !

17-11-9:服务器因资源问题,更新速度会延迟 ByXiaoXie !

17-11-20:服务器正在修复中,可能需要很长时间请等待 ByXiaoXie !

17-11-25:网站已恢复,请不要疯狂外传谢谢 ByXiaoXie !

17-12-24:已关闭视频服务器,原因:有狗在CC我的视频服务器,暂时关闭 ByXiaoXie !

17-12-28:需要访问的请联系我QQ:645993600 记得带上备注Nicokun,服务器还在被攻击着[熊孩子你继续] ByXiaoXie !

18-1-16:域名到期了,没收到如何回报,所以暂时倒闭了,如有意义赞助的请联系 Line:byxiaoxie 感谢你们的陪伴 !

18-4-14:NiCoKun已复活,请联系本人获取,不对外开放,谢谢 ByXiaoXie !

NiCoKun网站状态:已复活,请联系Line获取

头像

@byxiaoxie1年前

07/22
16:01
Home

Python3入门爬虫

HTML源代码:

<html xmlns=http://www.w3.org/1999/xhtml>
	<meta http-equiv=Content-Type content="text/html;charset=utf-8">
    <title>爬虫测试</title>
	
    <head>
        <body>
            <h1>任务1:把[P]标签内容利用爬虫全部读取出来.</h1>
            <h2>任务2:把[A]标签连接全部利用爬虫读取出来.</h2>
            <h2>任务3:把[Img]标签图片地址全部读取出来.</h2>
            <h1>任务4:读取完每一个后利用[\n]换行.</h1>
            <hr>
            <p>Test_P_1</p>
            <p>Test_P_2</p>
            <p>Test_P_3</p>
            <p>Test_P_4</p>
            <p>Test_P_5</p>
            <hr>
            <a href="https://baidu.com">连接1_baidu</a>
            <a href="https://byxiaoxie.com">连接2_byxiaoxie</a>
            <a href="http://xz.nicokun.com">连接3_nicokun</a>
            <hr>
            <img src="img_1.jpg" alt="图片1">
            <img src="img_2.jpg" alt="图片2">
            <img src="img_3.jpg" alt="图片3">
        </body>
    </head>
</html>

阅读全文 →

Python3入门爬虫

加载中……