算法源自网络(网络源码连接:http://www.mycodes.net/161/6659.htm)

  整体思路:用二维数组构建棋盘每一个数组元素封装为一个picturebox附带若干属性(例如:棋子归属方、棋子的类型),用一个抽象基类规定基本的棋子移动规则(例如:不能选中空白picturebox、该红方走棋时不能选中蓝方棋子),具体的棋子单独从基类棋子类派生 重写派生类的方法规定其走棋规则,和相应填充picturebox的图片(例如: 炮不能斜着走不能直线吃子,翻山炮必须吃子且移动路径上只能有一个棋子)  

  窗体所用控件:lable、timer、picturebox

  

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing; namespace 象棋_封_
{
enum chess_type
{
blank,
jiang,
che,
ma,
pao,
xiang,
zu,
shi
};//棋类的枚举类型
enum player_type
{
blank,
red,
blue,
};//玩家类别的枚举类型
abstract class Chess
{
private static Chess[] cover_blue =new Chess[];//被吃区
private static int r=;
private static Chess[] cover_red = new Chess[];//被吃区
private static int f=;
protected static int chosenX;
protected static int chosenY;
public static bool chosen;
static int n = ;
public static player_type control_side;
public PictureBox PB;
public chess_type type;
public player_type side;
public Chess()
{
side = player_type.blank;
type = chess_type.blank;
}
public abstract bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard);
public abstract void Put_picture();
//public void Assignment(chess_type ct, player_type pt, Image pic)
//{
// side = pt;
// type = ct;
// PB.Image = pic;
//}//给棋子赋值
public void Bg_Tored()
{
this.PB.BackColor = Color.Red;
}//背景变为红色
public void Bg_Toblank()
{
this.PB.BackColor = Color.Transparent;
}//背景变为白色
private void Chess_Toblank(ref Chess a, PictureBox PB)
{
this.Bg_Toblank();
this.PB.Image = null;
a = new Chess_blank(PB);
}//棋子属性清空
public static void Clearground(Main f, ref Chess[][] checkerboard)//布置战场
{
int i, j;
Control[] col_blue=null;
Control[] col_red=null;
Chess.control_side = player_type.red;
Chess.chosen = false;
//*********************初始化被吃区**************//
for (i = ; i < ; i++)
{
cover_blue[i] = new Chess_blank();
cover_red[i] = new Chess_blank();
}
for (i = ; i <= ; i++)
{
col_blue = f.Controls.Find("Cover_PBox_blue" + i, false);//检索控件
col_red = f.Controls.Find("Cover_PBox_red" + i, false);//检索控件
cover_blue[i - ].PB = col_blue[] as PictureBox;
cover_red[i - ].PB = col_red[] as PictureBox;
}
//*********************初始话被吃区**************// //*****************构建棋盘********************//
checkerboard = new Chess[][];
for (i = ; i < ; i++)
{
checkerboard[i] = new Chess[];//10行9列
}
for (i = ; i < ; i++)
for (j = ; j < ; j++)
{
checkerboard[i][j] = new Chess_blank();
}
checkerboard[][] = new Chess_che(player_type.blue);
checkerboard[][] = new Chess_ma(player_type.blue);
checkerboard[][] = new Chess_xiang(player_type.blue);
checkerboard[][] = new Chess_shi(player_type.blue);
checkerboard[][] = new Chess_jiang(player_type.blue);
checkerboard[][] = new Chess_shi(player_type.blue);
checkerboard[][] = new Chess_xiang(player_type.blue);
checkerboard[][] = new Chess_ma(player_type.blue);
checkerboard[][] = new Chess_che(player_type.blue);
checkerboard[][] = new Chess_pao(player_type.blue);
checkerboard[][] = new Chess_pao(player_type.blue);
checkerboard[][] = new Chess_zu(player_type.blue);
checkerboard[][] = new Chess_zu(player_type.blue);
checkerboard[][] = new Chess_zu(player_type.blue);
checkerboard[][] = new Chess_zu(player_type.blue);
checkerboard[][] = new Chess_zu(player_type.blue); checkerboard[][] = new Chess_zu(player_type.red);
checkerboard[][] = new Chess_zu(player_type.red);
checkerboard[][] = new Chess_zu(player_type.red);
checkerboard[][] = new Chess_zu(player_type.red);
checkerboard[][] = new Chess_zu(player_type.red);
checkerboard[][] = new Chess_pao(player_type.red);
checkerboard[][] = new Chess_pao(player_type.red);
checkerboard[][] = new Chess_che(player_type.red);
checkerboard[][] = new Chess_ma(player_type.red);
checkerboard[][] = new Chess_xiang(player_type.red);
checkerboard[][] = new Chess_shi(player_type.red);
checkerboard[][] = new Chess_jiang(player_type.red);
checkerboard[][] = new Chess_shi(player_type.red);
checkerboard[][] = new Chess_xiang(player_type.red);
checkerboard[][] = new Chess_ma(player_type.red);
checkerboard[][] = new Chess_che(player_type.red);
for (i = ; i < ; i++)
for (j = ; j < ; j++)//control 是一个存放控件类的容器
{
Control[] col = f.Controls.Find("pictureBox" + (i * + j + ), false);//检索控件
checkerboard[i][j].PB = col[] as PictureBox;//类型转换
checkerboard[i][j].PB.Location = new Point( + * j, * i);
}
for (i = ; i < ; i++)
for (j = ; j < ; j++)
{
checkerboard[i][j].Put_picture();
}
//*****************构建棋盘********************//
}
protected static int Getx(object sender)
{
int x;
string name = (sender as PictureBox).Name;
string number = name.Substring();//在字符串中从指定位开始检索(这里是在x后也就是picturebox控件ID不同的尾号)
int index = Convert.ToInt32(number);
x = (index - ) / ;//列
return x;
}
protected static int Gety(object sender)
{
int y;
string name = (sender as PictureBox).Name;
string number = name.Substring();//在字符串中从指定位开始检索(这里是在x后也就是picturebox控件ID不同的尾号)
int index = Convert.ToInt32(number);
y = (index - ) % ;//行
return y;
}
public static void Nochozen_dispose(object sender, Chess[][] checkerboard)
{
Chess.chosen = true;
chosenX = Chess.Getx(sender);
chosenY = Chess.Gety(sender);
if (checkerboard[chosenX][chosenY].side != control_side)//选择的不是当前应该走棋的一方
{
chosen = false;
return;
}
if (checkerboard[chosenX][chosenY].side != player_type.blank)//选择的不是空白
checkerboard[chosenX][chosenY].Bg_Tored();
return;
}
public static bool Chozen_dispose(object sender, Chess[][] checkerboard)
{
Chess.chosen = false;
int x= Getx(sender);
int y= Gety(sender);
if (checkerboard[chosenX][chosenY].side == checkerboard[x][y].side)//移动位置与选择位是同一阵营
{
checkerboard[chosenX][chosenY].Bg_Toblank();
return false;
}
if (checkerboard[chosenX][chosenY].side == player_type.blank)//选中的是空白
return false;
if (checkerboard[chosenX][chosenY].type == chess_type.ma || checkerboard[chosenX][chosenY].type == chess_type.xiang || checkerboard[chosenX][chosenY].type == chess_type.shi)//马象士的移动不能同y或同x
{
if (chosenX == x || chosenY == y)
{
checkerboard[chosenX][chosenY].Bg_Toblank();
return false;
}
}
else
{
if (chosenX != x && chosenY != y)//其他棋类都必须同x或同y移动
{
checkerboard[chosenX][chosenY].Bg_Toblank();
return false;
}
} if (!checkerboard[chosenX][chosenY].Move_judge(sender, x, y, checkerboard))
{
checkerboard[chosenX][chosenY].Bg_Toblank();
return false;
}
if (Chess.Setmove(checkerboard, x, y))
return true;
else
return false;
}
static bool Setmove(Chess[][] checkerboard,int X,int Y)
{
n++;
bool over = false;
player_type z=player_type.blank;
if (checkerboard[X][Y].type == chess_type.jiang)
{
over = true;
z = checkerboard[X][Y].side;
}
if (checkerboard[X][Y].PB.Image!=null)
Cover(checkerboard[X][Y]);
Chess.Change(ref checkerboard[Chess.chosenX][Chess.chosenY],ref checkerboard[X][Y]);
Chess.chosen = false;
if (over)
{
if (z == player_type.blue)
MessageBox.Show("红方胜利");
else
MessageBox.Show("蓝方胜利");
End f = new End(Time.fen + "分" + Time.miao + "秒");
f.Show();
return true;
}
if (n % == )
Chess.control_side = player_type.blue;
else
Chess.control_side = player_type.red;
return false;
}
private static void Change(ref Chess a,ref Chess b)//a子位移到b子
{
Chess c = new Chess_blank();
c.PB = b.PB;
switch (a.type)
{
case chess_type.zu:
b = new Chess_zu(a.side);break;
case chess_type.pao:
b = new Chess_pao(a.side);break;
case chess_type.che:
b = new Chess_che(a.side); break;
case chess_type.ma:
b = new Chess_ma(a.side); break;
case chess_type.xiang:
b = new Chess_xiang(a.side); break;
case chess_type.shi:
b = new Chess_shi(a.side); break;
case chess_type.jiang:
b = new Chess_jiang(a.side); break;
}
b.type = a.type;
b.side = a.side;
b.PB = c.PB;
b.PB.Image = a.PB.Image;
a.Chess_Toblank(ref a,a.PB);
}
private static void Cover(Chess a)
{
if (a.side == player_type.blue)
{
Change(ref a, ref cover_red[r]);
r++;
}
else
{
Change(ref a, ref cover_blue[f]);
f++;
} }//棋子被吃后移动到被吃区 }
}

棋子抽象基类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace 象棋_封_
{
class Chess_blank : Chess
{
public Chess_blank()
{
base.type = chess_type.blank;
base.side = player_type.blank;
}
public Chess_blank(PictureBox PB)
{
base.type = chess_type.blank;
base.side = player_type.blank;
this.PB = PB;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
return false;
}
public override void Put_picture()
{
this.PB.Image = null;
}
}
}

空白属性棋子类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_che:Chess
{
public Chess_che(player_type b)
{
base.type = chess_type.che;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
int i, j, k;
if (Chess.chosenX == X)
{
i = Chess.chosenY < Y ? Chess.chosenY : Y;
j = Chess.chosenY > Y ? Chess.chosenY : Y;
for (k = i + ; k < j; k++)
{
if (checkerboard[X][k].side != player_type.blank)//在移动路径上有棋子情况
{
return false;
}
}
}
if (Chess.chosenY == Y)
{
i = Chess.chosenX < X ? Chess.chosenX : X;
j = Chess.chosenX > X ? Chess.chosenX : X;
for (k = i + ; k < j; k++)
{
if (checkerboard[k][Y].side != player_type.blank)
{
return false;
}
}
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红車;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝車;
}
}
}

车类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_jiang:Chess
{
public Chess_jiang(player_type b)
{
base.type = chess_type.jiang;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
int i, j, k;
if (checkerboard[X][Y].type == chess_type.jiang && Chess.chosenY == Y)//王吃王情况
{
i = Chess.chosenX < X ? Chess.chosenX : X;//棋子移动的起点行
j = Chess.chosenX > X ? Chess.chosenX : X;//棋子移动的结束行
for (k = i + ; k < j; k++)
{
if (checkerboard[k][Y].side != player_type.blank)//中间有棋子情况
{
return false;
}
}
return true;
}
if (this.side == player_type.blue)
{ if (Y < || Y > || X > )//当控制者是蓝色方 限制将的移动范围
{
return false;
}
}
else
{
if (Y < || Y > || X < )//当控制者是红色方 限制将的移动范围
{
return false;
}
}
if ((Chess.chosenX - X) * (Chess.chosenX - X) + (Chess.chosenY - Y) * (Chess.chosenY - Y) != )//点到点距离x平方加y平方
{
return false;
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红帥;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝将;
}
}
}

将类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_ma:Chess
{
public Chess_ma(player_type b)
{
base.type = chess_type.ma;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
if (Math.Abs(Chess.chosenX - X) == && Math.Abs(Chess.chosenY - Y) == )//移动X方向绝对值为1y方向为2
{
if (checkerboard[Chess.chosenX][Chess.chosenY + (Y - Chess.chosenY) / Math.Abs(Y - Chess.chosenY)].side != player_type.blank)//不是撇脚马
{
return false;
}
}
else if (Math.Abs(Chess.chosenX - X) == && Math.Abs(Chess.chosenY - Y) == )//移动y方向绝对值为2x方向为1
{
if (checkerboard[Chess.chosenX + (X - Chess.chosenX) / Math.Abs(X - Chess.chosenX)][Chess.chosenY].side != player_type.blank)//不是撇脚马
{
return false;
}
}
else
{
return false;
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红马;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝马;
}
}
}

马类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_pao:Chess
{
public Chess_pao(player_type b)
{
base.type = chess_type.pao;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
int p = ;//用于记录路径上的棋子数
int i, j, k;
if (Chess.chosenX == X)//同列移动情况
{
i = Chess.chosenY < Y ? Chess.chosenY : Y;//定起始点
j = Chess.chosenY > Y ? Chess.chosenY : Y;//定起始点
p = ;
for (k = i + ; k < j; k++)
{
if (checkerboard[X][k].side != player_type.blank)
{
p++;//移动路径上有棋子的个数
}
}
if (p > )
{
return false;
}
} else if (Chess.chosenY == Y)//同行移动情况
{
i = Chess.chosenX < X ? Chess.chosenX : X;
j = Chess.chosenX > X ? Chess.chosenX : X;
p = ;
for (k = i + ; k < j; k++)
{
if (checkerboard[k][Y].side != player_type.blank)
{
p++;
}
}
if (p > )
{
return false;
}
}
else
{
return false;
}
if (p == && checkerboard[X][Y].side != player_type.blank)//中间没有棋子炮不能吃子
{
return false;
}
if (p == && checkerboard[X][Y].side == player_type.blank)//中间有棋子但是不能打空炮
{
return false;
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红炮;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝炮;
}
}
}

炮类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_shi:Chess
{
public Chess_shi(player_type b)
{
base.type = chess_type.shi;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
if (this.side == player_type.blue)
{
if (Y < || Y > || X > )//限制将的移动范围
{
return false;
}
}
else
{
if (Y < || Y > || X < )//限制将的移动范围
{
return false;
}
}
if (Math.Abs(X - Chess.chosenX) != || Math.Abs(Chess.chosenY - Y) != )//只能跨一个方格
{
return false;
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红士;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝士;
}
}
}

士类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_xiang:Chess
{
public Chess_xiang(player_type b)
{
base.type = chess_type.xiang;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
if (this.side == player_type.blue)
{
if (X > )
{
return false;
}
}
else
{
if (X < )
{
return false;
}
}
if ((X - Chess.chosenX) * (X - Chess.chosenX) + (Chess.chosenY - Y) * (Chess.chosenY - Y) != )
{
return false;
}
if (checkerboard[(X + Chess.chosenX) / ][(Y + Chess.chosenY) / ].side != player_type.blank)
{
return false;
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红象;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝象;
}
}
}

象类

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace 象棋_封_
{
class Chess_zu:Chess
{
public Chess_zu(player_type b)
{
base.type = chess_type.zu;
base.side = b;
}
public override bool Move_judge(object sender, int X, int Y, Chess[][] checkerboard)
{
if (this.side == player_type.blue)//蓝方卒
{
if (Chess.chosenX < && X - Chess.chosenX != )//在5行后选中的卒
{
return false;
}
if (Chess.chosenX > )//移动布数不能大于1
{
if (X == Chess.chosenX && Math.Abs(Y - Chess.chosenY) != )
{
return false;
}
if (Y == Chess.chosenY && X - Chess.chosenX != )
{
return false;
}
}
}
else//红方卒
{
if (Chess.chosenX > && Chess.chosenX - X != )
{
return false;
}
if (Chess.chosenX < )
{
if (X == Chess.chosenX && Math.Abs(Y - Chess.chosenY) != )
{
return false;
}
if (Y == Chess.chosenY && Chess.chosenX - X != )
{
return false;
}
}
}
return true;
}
public override void Put_picture()
{
if (base.side == player_type.red)
this.PB.Image = global::象棋_封_.Properties.Resources.红兵;
else
this.PB.Image = global::象棋_封_.Properties.Resources.蓝卒;
}
}
}

卒类

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace 象棋_封_
{
public partial class Start : Form
{
public Start()
{
InitializeComponent();
} private void LB_Begin_Click(object sender, EventArgs e)
{
Main f = new Main();
f.Show();
this.Hide();
} private void label2_Click(object sender, EventArgs e)
{
About f = new About();
f.Show();
this.Hide();
} private void LB_exit_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}

主窗体代码

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace 象棋_封_
{
class Time
{
public Timer t;
private Label l;
private double s ;
private double m ;
public double sum=;
public static string fen="";
public static string miao ="";
public Time(Timer t,Label L)
{
s = ;
m = ;
this.t = t;
this.l = L;
}
public string outtime()
{
string second;
string minute;
s++;
if (s >= )
{
m = s / ;
s = s % ;
}
second = Convert.ToString(s);
minute = Convert.ToString(m);
string sum = minute + ":" + second;
return sum;
}
public void clear()
{
fen = (Convert.ToInt32(fen) + m).ToString();
miao = (Convert.ToInt32(miao) + s).ToString();
l.Text = "";
m = ;
s = ;
}
}
}

timer类

      

简单的c#winform象棋游戏(附带源码)的更多相关文章

  1. 【原创】使用HTML5+canvas+JavaScript开发的原生中国象棋游戏及源码分享

    目前已经实现的功能: V1.0 : 实现棋子的布局,画布及游戏场景的初始化V2.0 : 实现棋子的颜色改变V3.0 :实现所有象棋的走棋规则V4.0 : 实现所有棋子的吃子功能 GItHub源码下载地 ...

  2. HTML5之中国象棋,附带源码!

    好久没写随笔了,好怀恋2013年的日子,因为现在不能回到过去了! 再见了 感谢你为我做的一切! 进入正题:HTML5之中国象棋 很小就会下象棋了,  这是象棋的测试地址:点击我吧   然后点击里面的象 ...

  3. 自定义实现简单的Android颜色选择器(附带源码)

    在写Android App过程中需要一个简单的颜色选择器,Android自带的ColorPicker和网上的一些ColorPicker都太高端了,都实现了颜色渐变功能,我要的不需要那么复杂,只想提供几 ...

  4. C#470多例winform 界面特效的源码

    一共470多例winform 界面特效的源码. 窗体与界面设计... 9 实例001  带历史信息的菜单    10 实例002  菜单动态合并    12 实例003  像开始菜单一样漂亮的菜单.. ...

  5. 猜拳游戏GuessGame源码

    该游戏是一款比较不错的猜拳游戏GuessGame源码案例,GuessGame——猜拳游戏,这也是我自己的第一款休闲类的游戏案例,游戏实现也比较简单的,希望这个能够帮大家的学习和使用,更多安卓源码尽在源 ...

  6. 双人对战的球类游戏IOS源码

    双人对战的球类游戏源码,这个是一款双人对战的ios球类游戏源码,游戏的源码也比较详细的,我们在屏幕上下看到各有一个球门,内有一球,两边通过控制轮盘使球进入对方的球门的,其实玩法也很简单的,我们知道体育 ...

  7. 【Hook技术】实现从"任务管理器"中保护进程不被关闭 + 附带源码 + 进程保护知识扩展

    [Hook技术]实现从"任务管理器"中保护进程不被关闭 + 附带源码 + 进程保护知识扩展 公司有个监控程序涉及到进程的保护问题,需要避免用户通过任务管理器结束掉监控进程,这里使用 ...

  8. iOS 指南针的制作 附带源码

    iOS  指南针的制作  附带源码 代码下载地址: http://vdisk.weibo.com/s/HK4yE   http://pan.baidu.com/share/link?shareid=7 ...

  9. 【轮子狂魔】抛弃IIS,打造个性的Web Server - WebAPI/Lua/MVC(附带源码)

    引言 此篇是<[轮子狂魔]抛弃IIS,向天借个HttpListener - 基础篇(附带源码)>的续篇,也可以说是提高篇,如果你对HttpListener不甚了解的话,建议先看下基础篇. ...

随机推荐

  1. [转]使用Enumeration和Iterator遍历集合类

    原文地址:http://www.cnblogs.com/xwdreamer/archive/2012/05/30/2526268.html 前言 在数据库连接池分析的代码实例中,看到其中使用Enume ...

  2. jquery option

    转--jquery动态添加option示例 http://www.jb51.net/article/45031.htm //js动态添加option var sel= document.getElem ...

  3. ssh 登录慢?

    修改 /etc/ssh/sshd_config 文件中对应的配置为: GSSAPIAuthentication no UseDNS=no 修改 /etc/nsswitch.conf 文件中对应的配置为 ...

  4. vs中使用git

    vs中使用git 一.概念 Git是一个强调速度的分布式版本控制软件和源代码管理系统(SCM,source code management).Git最初是由Linus Torvalds为内核开发而设计 ...

  5. C#检验参数合法性公用方法

    #region 检验参数合法性,数值类型不小于0,引用类型不能为null,否则抛出异常 /// <summary> /// 检验参数合法性,数值类型不小于0,引用类型不能为null,否则抛 ...

  6. 用flashfxp做ftp镜像同步

    简单说,用flashfxp建立上传或者下载队列,然后设定一个定时任务来处理这个队列,就能同步下载或上传制定的目录了. 本人遇到的需求只需要做同步上传,记录如下: 开发者PC ---> 国内win ...

  7. ElasticSearch中bulkProcesser使用

    初次接触es,可能对增删改查很熟悉,以为能为得心应手,本次应用场景为 数据库变更一条记录,会触发更新es中的数据,每秒并发大概30条左右,测试环境一切工作正常(数据量较少),上线后发现日志中很多类似于 ...

  8. Java学习笔记-按值传递

    参数的值传递 实参必须与方法中次你故意的参数在次序和数量上匹配,在类型上兼容.类型兼容是指不需要经过显式的类型转换,实参的值就可以传递给形参.如将int型的实参值传递给double型形参. 当调用方法 ...

  9. java创建文件和目录

    java创建文件和目录 2013-09-04 12:56 99933人阅读 评论(7) 收藏 举报  分类: JAVA基础(10)  版权声明:本文为博主原创文章,未经博主允许不得转载. 创建文件和目 ...

  10. svn: E200007: Runner for 'org.tmatesoft.svn.core.wc2.SvnMerge' command have not been found; probably not yet implement in this API.

    myeclipse分支合并主干(分支->team->合并->选择主干)的时候出现这个错误: svn: E200007: Runner for 'org.tmatesoft.svn.c ...