标签归档:C#

利用C# WINFORM 模拟操作制作外挂

给客户制作了一个刷游戏任务的PC外挂,利用C#获取窗口句柄,进行操作实现。

此方法,只适用于可以获取到句柄的游戏,获取不到的可以用按键精灵制作,手机也一样。

现在年代的外挂基本都基于简化操作,而不是以前的那种攻击数据,现在技术很难突破,除非自己人,实现核心代码如下,记录一下:

继续阅读

C#操作EXCEL以及生成公司公章

最近项目需求 做了个小工具 操作EXCEL以及生成公司公章

TestOnSeal _top = new TestOnSeal();
            _top.TextFont = new System.Drawing.Font("黑体", 16, FontStyle.Bold);
            _top.FillColor = Color.Red;
            //_top.ColorTOP = Color.Black;
            _top.Text = comname;
            _top.BaseString = "";
            _top.ShowPath = true;
            _top.LetterSpace = 1;
            _top.SealSize = 180;
            _top.CharDirection = Char_Direction.Center;
            _top.SetIndent(20);
            Graphics g = this.CreateGraphics();
            g.DrawImage(_top.TextOnPathBitmap(), 0, 0);

            _top.CharDirection = Char_Direction.ClockWise;
            g.DrawImage(_top.TextOnPathBitmap(), 180, 0);

            _top.CharDirection = Char_Direction.AntiClockWise;
            g.DrawImage(_top.TextOnPathBitmap(), 0, 180);

            _top.SetIndent(20);
            _top.CharDirection = Char_Direction.Center;
            g.DrawImage(_top.TextOnPathBitmap(), 180, 180);

            _top.TextOnPathBitmap().Save(System.Windows.Forms.Application.StartupPath + "/tp/" + comname + ".png",  System.Drawing.Imaging.ImageFormat.Png);

            g.Dispose();

项目下载

C# GDI画图 两张图片合并

好久没发文章了,整点东西上来,废话就不多说了,代码如下:

Bitmap bmp1 = new Bitmap(Application.StartupPath + "\\1.png");
            Bitmap bmp2 = new Bitmap(Application.StartupPath + "\\1.jpg");
            using (Graphics g = Graphics.FromImage(bmp1))
            {
                Size size = new Size(265, 265);
                Rectangle rect = new Rectangle(new Point(bmp1.Width - size.Width - 118, 96), size);
                g.DrawImage(bmp2, rect, new Rectangle(0, 0, bmp2.Width, bmp2.Height), GraphicsUnit.Pixel);
                bmp1.Save(Application.StartupPath + "\\C.jpg");
            }

C#动态创建DataTable 绑定到数据

动态创建DataTable 绑定到数据

 DataTable dt = new DataTable("DataXML");
            //创建列
            dt.Columns.Add(new DataColumn("任务名称", typeof(string)));
            dt.Columns.Add(new DataColumn("开始时间", typeof(string)));
            dt.Columns.Add(new DataColumn("结束时间", typeof(string)));
            dt.Columns.Add(new DataColumn("任务状态", typeof(string)));
            //加载XML
            xmlDom.Load(Application.StartupPath + @"\Config\Config.xml");
            foreach (XmlNode xnode in xmlDom.SelectSingleNode("djob").SelectNodes("item"))
            {
                DataRow row = dt.NewRow();
                row["任务名称"] = xnode.SelectSingleNode("name").InnerText;
                row["开始时间"] = xnode.SelectSingleNode("startTime").InnerText;
                row["结束时间"] = xnode.SelectSingleNode("endTime").InnerText;
                row["任务状态"] = xnode.SelectSingleNode("state").InnerText == "0" ? "准备就绪" : "正在运行";
                dt.Rows.Add(row);
            }
            DataSet ds = new DataSet("data");
            ds.Tables.Add(dt);