随笔 - 850  文章 - 37  评论 - 173  阅读 - 287万
10 2013 档案
C# Get Desktop Screenshot ZZ
摘要:I found this feature while looking inside Graphics class and since it was so simple to use, I decided to post it here.As I said, it doesn't require more than 15 lines of code - this function: Graphics.CopyFromScreen does all the 'hard work' so we only need to put this into a Bitmap and s 阅读全文
posted @ 2013-10-20 09:43 武胜-阿伟 阅读(507) 评论(0) 推荐(0) 编辑
C#/PHP Compatible Encryption (AES256) ZZ
摘要:Finding a way to encrypt messages in C# and decrypting them in PHP or vice versa seems to be a "challenge" for many users. I wrote this tutorial to provide some help with this: below, you can find how to encrypt / decrypt messages in C# / PHP using AES256 with CBC mode.1.Basic InformationA 阅读全文
posted @ 2013-10-20 09:41 武胜-阿伟 阅读(1728) 评论(0) 推荐(0) 编辑
C# Sending data using GET or POST ZZ
摘要:In this short article, I'll show you how to send data to a website from a C# application using GET or POST method. The tutorial also includes how to receive data from a website, by getting the page's source - so it's a neat way to check if the everything is working as intended.1. GET Met 阅读全文
posted @ 2013-10-20 09:40 武胜-阿伟 阅读(475) 评论(0) 推荐(0) 编辑
gmail
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net.Mail;using System.Net;namespace smtp_client{ class Program { static void Main (string[] args) { MailAddress myemail = new MailAddress("me@gmail.com", "Name"); MailAddress mail_to = 阅读全文
posted @ 2013-10-20 09:39 武胜-阿伟 阅读(292) 评论(0) 推荐(0) 编辑
load dll
摘要:Assembly myassembly = Assembly.LoadFrom("testdll.dll"); Type type = myassembly.GetType("testdll.Class1"); object instance = Activator.Createinstance(type); MethodInfo[] methods = type.GetMethods(); object res = methods[0].Invoke(instance, new object[] {5, 3}); 阅读全文
posted @ 2013-10-20 09:36 武胜-阿伟 阅读(204) 评论(0) 推荐(0) 编辑
C# Read/Write another Process' Memory ZZ
摘要:Today's tutorial is about...processes' memory! In this article I'll show you how to read/write a process' memory using C#. This is a good way to learn a part of WinAPI and also understand the basics of memory allocation. Before starting, we need a "target" - I choose notepa 阅读全文
posted @ 2013-10-20 09:31 武胜-阿伟 阅读(1002) 评论(0) 推荐(0) 编辑
C# Protect the Password inside a TextBox ZZ
摘要:If the Text property is called, it will send an WM_GETTEXT message, so it will surely be an internal (safe) call. But if that message is received and the Text property wasn't called, then it might be risky to return the password, so we'll not process that message.I wrote a "safer" 阅读全文
posted @ 2013-10-20 09:27 武胜-阿伟 阅读(358) 评论(0) 推荐(0) 编辑
处理上百万条的数据库如何提高处理查询速度
摘要:处理上百万条的数据库如何提高处理查询速度1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null可以在num上设置默认值0,确保表中num列没有null值,然后这样查询:select id from t where num=03.应尽量避免在 where 子句中使用!=或操作符,否则将引擎放弃使用索引而进行全表扫描。4.应尽量避免在 where 子句中使用 or 来 阅读全文
posted @ 2013-10-18 22:34 武胜-阿伟 阅读(301) 评论(0) 推荐(0) 编辑
你我千万要看 决定孩子命运的七个习惯
摘要:作为家长希望子女成才,作为一个社会的一员,每个人都希望自己有个好的未来。为此,你和他千万要看,你的愿望就能实现。如果你养成好的习惯,你一辈子都享受不尽它的利息;如果你养成了坏的习惯,你一辈子都偿还不尽它的债务……人在小的时候就要训练出好习惯。因为这些习惯关乎到今后命运大事业。以下7个好习惯,父母从小就应该培养孩子。 习惯一:做事有计划做事有计划的人才会赢得信任。有些孩子每到期末复习就一团乱麻,做作业时总是被别的事情打乱,早晨起床上学常常找不到袜子,零用钱花不到月底就一分不剩……您的孩子会被这样的问题困扰吗?您知道怎样才能让孩子避免这些麻烦吗?最好的方法就是让孩子学会做事有计划,即对自己要做的事 阅读全文
posted @ 2013-10-16 17:21 武胜-阿伟 阅读(455) 评论(0) 推荐(0) 编辑
Colour your Log4Net events in your RichTextBox zz
摘要:You’re most probably here because you have already read my article How to watch your log through your application in Log4Net and you’re thinking “that’s great, but I need to somehow differentiate all of this output!” – either that or you just really need a handy way to format certain keywords within 阅读全文
posted @ 2013-10-16 08:42 武胜-阿伟 阅读(496) 评论(0) 推荐(0) 编辑
单实例 winform zz
摘要:(引用了 Microsoft.VisualBasic.ApplicationServices)SingleInstanceApplicationWrapper.csusing System.Windows.Forms;using Microsoft.VisualBasic.ApplicationServices; namespace Highflyer{ /// /// 单实例应用程序封装类 /// public class SingleInstanceApplicationWrapper : WindowsFormsApplicationBase { ... 阅读全文
posted @ 2013-10-16 08:20 武胜-阿伟 阅读(218) 评论(0) 推荐(0) 编辑
log4net封装类 zz
摘要:封装说明: 1.使用静态方法调用即可写入日志。 2.在日志信息写入之前,定义委托处理日志信息,便于记录日志信息之前,显示给用户。 3.添加代码配置Log4net,避免应用程序总是携带配置文件。如果需要使用配置文件,即可在AssemblyInfo.cs添加 [assembly:log4net.Config.XmlConfigurator(ConfigFile="log.xml",Watch=false)]展开代码/* ============================================================================== * 阅读全文
posted @ 2013-10-16 08:16 武胜-阿伟 阅读(426) 评论(0) 推荐(0) 编辑
win8下光驱消失
摘要:导入这个注册表后重启,总算能读了..reg add "HKLM\System\CurrentControlSet\Services\atapi\Controller0" /f /v EnumDevice1 /t REG_DWORD /d 0x00000001我也有遇到这问题,不管怎么弄,光驱就是不出现。执行命令提示字符(管理员),然后输入reg.exe add "HKLM\System\CurrentControlSet\Services\atapi\Controller0" /f /v EnumDevice1 /t REG_DWORD /d 0x000 阅读全文
posted @ 2013-10-11 12:36 武胜-阿伟 阅读(389) 评论(0) 推荐(0) 编辑
C#中使用反射获取结构体实例
摘要:static void Main(string[] args){ Type type = typeof(MyStruct); object obj1 = type.Assembly.CreateInstance(type.FullName);}struct MyStruct{}使用这个方法就不用管class还是struct 都是可以用的,如果是class只要保证有无参构造函数就可以了**** Activator.CreateInstance(Type) 阅读全文
posted @ 2013-10-09 08:32 武胜-阿伟 阅读(542) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示