前几天,遇到一个问题,就是在浏览器地址栏传递中文时,出现乱码,考虑了一下,解决方式有很多,我还是采用了转换编码的方式,将中文转换为Unicode编码,然后再解码成中文,以下是实现的过程,非常简单!package cy.code;public class CyEncoder {private Stri...
分类:
其他好文 时间:
2014-07-16 21:38:12
阅读次数:
855
网上搜罗了的代码 做了下改进。 B/S C/S 都能用。 1 private static string GetIP4Address() 2 { 3 string IP4Address = String.Empty; 4 5 if (...
分类:
其他好文 时间:
2014-07-16 21:30:35
阅读次数:
164
#include #include using namespace std;class Single{public: static Single* ShareInstance(); static void ReleaseInstance();private: Single(); ...
分类:
编程语言 时间:
2014-07-16 21:08:19
阅读次数:
264
用Resharper的同学都知道,如果你写了一个私有函数,这个函数没有访问类里面的其他参数和方法,那么它建议你标记这个方法为私有静态方法,提示是这样的:值得这样做吗?看看微软的建议:After you mark the methods as static, the compiler will emi...
分类:
其他好文 时间:
2014-07-16 20:58:08
阅读次数:
206
服务端-监听接收#include "winsock2.h"#pragma comment(lib,"WS2_32.LIB")int bufi;class mserver{private: SOCKET ssock,csock; sockaddr_in saddr,cadd...
分类:
编程语言 时间:
2014-07-16 20:45:32
阅读次数:
122
1.直接使用Tpublic class GenericArray { private T[] array; public GenericArray(int size){ array = (T[]) new Object[size]; } publ...
分类:
其他好文 时间:
2014-07-16 20:41:02
阅读次数:
134
public class SqliteHelper { //获取连接字符串 private static readonly string str = ConfigurationManager.ConnectionStrings["conStr"].Connect...
分类:
数据库 时间:
2014-07-16 20:23:59
阅读次数:
192
相关控件初始化方法:showSmscPref private voidshowSmscPref() { int count = MSimTelephonyManager.getDefault().getPhoneCount(); boolean airplaneModeOn = Settings.S...
分类:
移动开发 时间:
2014-07-13 10:58:45
阅读次数:
311
仅仅作为简单的记录,不多说直接上代码(仅测试使用): private void Test() { Regex ConnoteA = new Regex("^[a-zA-Z]\\d{8}$"); Regex ConnoteAA ...
分类:
其他好文 时间:
2014-07-13 10:11:07
阅读次数:
196
[DllImport("user32.dll", EntryPoint="SendMessageA")] private static extern int SendMessage(IntPtr hwnd, uint wMsg, uint wParam, uint lParam); ...
分类:
其他好文 时间:
2014-07-13 09:47:54
阅读次数:
196