/// /// 监听并返回数据 /// /// public static void TcpSocketReceive() { try { ...
分类:
其他好文 时间:
2015-04-03 18:49:15
阅读次数:
161
PrintStream ps; try { ps = new PrintStream("D:\\role.txt"); System.setOut(ps); } catch (FileNotFoundException e) { e.printStackTrace(); }
分类:
其他好文 时间:
2015-04-03 13:14:07
阅读次数:
138
今天去逛论坛 时发现了一个很有趣的问题:谁能给我我解释一下这段程序的结果为什么是:2.而不是:3代码如下:class Test { public int aaa() { int x = 1; try { return ++x; } catch (Exception e) { } fina...
分类:
其他好文 时间:
2015-04-03 11:01:33
阅读次数:
140
1 /** 2 * 判断Android系统API的版本 3 * 4 * @return 5 */ 6 publicstaticint getAPIVersion(){ 7 intAPIVersion; 8 try{ 9 APIVersion=Integer.valueO...
分类:
移动开发 时间:
2015-04-03 10:52:28
阅读次数:
144
简单粗暴,直接上代码:
XmlDocument xmlDoc = new XmlDocument();
try
{
xmlDoc.Load(Help.basePath);
XmlNode root = xmlDoc.SelectSingleNode("//screenshot");
if (root != null)
{
...
C# winform 判断当前参数值与节点中的值是否一致
public static bool CheckValues(string isscreenshot, string screenshottime, string screenshotsavepath)
{
try
{
bool flage = false;
DataTable dt = ReturnTbByReradxml...
try
{
Image image = new Bitmap(width, height);
Graphics g = Graphics.FromImage(image);
g.CopyFromScreen(x, y, 0, 0, new System.Drawing.Size(width, height));
string hour = Dat...
static void Main(string[] args) { while (true) { string rn = Console.ReadLine(); string s ...
分类:
其他好文 时间:
2015-04-03 09:11:36
阅读次数:
111
while (true) { Console.Write("请输入一个年份:"); string a = Console.ReadLine(); string b = ""; try { DateTime c = Convert.ToDateTime(a+"-2-29"); b="年是闰年"; } ...
分类:
其他好文 时间:
2015-04-03 09:08:32
阅读次数:
133
//在newStringEntity(params,"utf-8")指定为utf-8编码
try{
HttpClientclient=newDefaultHttpClient();
HttpPosthttpPost=newHttpPost(url);
//设置编码,防止中文传输乱码
StringEntityentity=newStringEntity(contentValue.toString(),"utf-8");
httpPost.setEntity(entity);..
分类:
其他好文 时间:
2015-04-03 06:59:45
阅读次数:
175