- 博客(1)
- 资源 (6)
- 收藏
- 关注
原创 三国全明星辅助说明
下载完成后,解压打开SanGouRobot.exe 如果打开时出现错误,请先阅读压缩包里面的 "使用阅读.txt" 打开之后如下图,登录你游戏账号的QQ号码 登录成功之后,按你熟悉的流程进入到游戏页面, 等完全进入到游戏界面后,按上面的"下一步"按钮. 按了按钮如果出现以下情况 情况 A. 解决办法: 在这个界面待定10秒左右再试
2014-05-27 13:12:29
4560
1
redismanage可视化管理工具
1. 多样化管理服务器,支持服务器的密码认证服务.
2. 支持所有redis的数据类型.
3. 支持单个key的重命名功能.
4. 支持单个key的删除功能.
5. 支持查看key数据的大小,引用等辅助属性.
6. 列表类的数据可分页,加快查看速度,不卡死.
7. 支持生命周期的修改以及移除功能
8. 对key包增加了支持, 查看更直观,更清爽.
2016-11-23
redis可视化管理工具
redis可视化管理工具,支持redis中各种类型的查看,删除,修改,重置生命周期等操作,支持同时操作多个服务器.
2015-09-24 更新版本2.1
1. 添加服务器打开,关闭,属性等菜单操作
2. 添加键值的缓存生命周期的设置
3. 添加相关帮助菜单以及反馈信息
4. 优化list,set,hash,zset的分页操作,很大程度上避免了程序的崩溃
5. 优化布局,使用更方便快捷
6. 修复若干bugs
2015-07-04 初版发布1.0
1. redis可视化工具发布
2. 支持redis各种类型的查询,删除,添加元素等操作
3. 支持多服务器链接,支持服务器加密码链接
2015-10-13
Socket通信C#源码
.NET下的socket通信源代码,源代码包括服务端和客户端的2个工程包文件,有了这个源代码那么我们学习通信就十分方便快捷了,代码采用C#编写。全部测试通过绝对没有什么问题!
2013-04-19
俄罗斯方块C#源码
c# 做的俄罗斯方块
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace ChinaBlock
{
class Block
{
public Square square1; //组成block的四个小方块
public Square square2;
public Square square3;
public Square square4;
private const int squareSize = GameField.SquareSize; //小方块的边长
public enum BlockTypes
{
undefined = 0,
square = 1,
line = 2,
J = 3,
L = 4,
T = 5,
Z = 6,
S = 7
};//一共有7种形状
public BlockTypes blockType; //方块的形状
//七个小方块的颜色数组
private Color foreColor;
private Color backColor;
//方块的方向
public enum RotateDirections
{
North = 1,
East = 2,
South = 3,
West = 4
};
public RotateDirections myRotation = RotateDirections.North;
public Block(Point thisLocation,BlockTypes bType)
{ //当blockType为undefined时,随机产生方块形状
Random rand=new Random();
if (bType == BlockTypes.undefined)
{
blockType = (BlockTypes)(rand.Next(7) + 1);
}
else
blockType = bType;
//设置四小方块的颜色
int i=(int)blockType-1;
foreColor = GameField.BlockForeColor[i];
backColor = GameField.BlockBackColor[i];
Size squareS=new Size(squareSize,squareSize);
square1 = new Square(squareS, foreColor, backColor);
square2 = new Square(squareS, foreColor, backColor);
square3 = new Square(squareS, foreColor, backColor);
square4 = new Square(squareS, foreColor, backColor);
//设置小方块的位置,组合成指定形状的一个大方块
switch (blockType)
{
case BlockTypes.square:
//组合成正方形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X,thisLocation.Y+squareSize);
square4.location = new Point(thisLocation.X+squareSize,thisLocation.Y+squareSize);
break;
case BlockTypes.line:
//组合成线形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X + 2 * squareSize, thisLocation.Y);
square4.location = new Point(thisLocation.X + 3 * squareSize, thisLocation.Y);
break;
case BlockTypes.J:
//组合成J形
square1.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
square3.location = new Point(thisLocation.X + squareSize, thisLocation.Y + 2 * squareSize);
square4.location = new Point(thisLocation.X, thisLocation.Y + 2 * squareSize);
break;
case BlockTypes.L:
//组合成l形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X, thisLocation.Y + squareSize);
square3.location = new Point(thisLocation.X, thisLocation.Y + 2 * squareSize);
square4.location = new Point(thisLocation.X + squareSize, thisLocation.Y + 2 * squareSize);
break;
case BlockTypes.T:
//组合成T形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X + 2*squareSize, thisLocation.Y);
square4.location = new Point(thisLocation.X + squareSize, thisLocation.Y +squareSize);
break;
case BlockTypes.Z:
//组合成z形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
square4.location = new Point(thisLocation.X + 2*squareSize, thisLocation.Y + squareSize);
break;
case BlockTypes.S:
//组合成S形
square1.location = new Point(thisLocation.X, thisLocation.Y + squareSize);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
square3.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square4.location = new Point(thisLocation.X + 2 * squareSize, thisLocation.Y);
break;
}
}
//含有自定义颜色的重载
public Block(Point thisLocation, BlockTypes bType,Color fc,Color bc)
{ //当blockType为undefined时,随机产生方块形状
Random rand = new Random();
if (bType == BlockTypes.undefined)
{
blockType = (BlockTypes)(rand.Next(7) + 1);
}
else
blockType = bType;
//设置四小方块的颜色
Size squareS = new Size(squareSize, squareSize);
square1 = new Square(squareS, fc, bc);
square2 = new Square(squareS, fc, bc);
square3 = new Square(squareS, fc, bc);
square4 = new Square(squareS, fc, bc);
//设置小方块的位置,组合成指定形状的一个大方块
switch (blockType)
{
case BlockTypes.square:
//组合成正方形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X, thisLocation.Y + squareSize);
square4.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
break;
case BlockTypes.line:
//组合成线形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X + 2 * squareSize, thisLocation.Y);
square4.location = new Point(thisLocation.X + 3 * squareSize, thisLocation.Y);
break;
case BlockTypes.J:
//组合成J形
square1.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
square3.location = new Point(thisLocation.X + squareSize, thisLocation.Y + 2 * squareSize);
square4.location = new Point(thisLocation.X, thisLocation.Y + 2 * squareSize);
break;
case BlockTypes.L:
//组合成l形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X, thisLocation.Y + squareSize);
square3.location = new Point(thisLocation.X, thisLocation.Y + 2 * squareSize);
square4.location = new Point(thisLocation.X + squareSize, thisLocation.Y + 2 * squareSize);
break;
case BlockTypes.T:
//组合成T形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X + 2 * squareSize, thisLocation.Y);
square4.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
break;
case BlockTypes.Z:
//组合成z形
square1.location = new Point(thisLocation.X, thisLocation.Y);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square3.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
square4.location = new Point(thisLocation.X + 2 * squareSize, thisLocation.Y + squareSize);
break;
case BlockTypes.S:
//组合成S形
square1.location = new Point(thisLocation.X, thisLocation.Y + squareSize);
square2.location = new Point(thisLocation.X + squareSize, thisLocation.Y + squareSize);
square3.location = new Point(thisLocation.X + squareSize, thisLocation.Y);
square4.location = new Point(thisLocation.X + 2 * squareSize, thisLocation.Y);
break;
}
}
/*画方块*/
public void Draw(System.IntPtr winHandle)
{
square1.Draw(winHandle);
square2.Draw(winHandle);
square3.Draw(winHandle);
square4.Draw(winHandle);
}
/*擦方块*/
public void Erase(System.IntPtr winHandle)
{
square1.Erase(winHandle);
square2.Erase(winHandle);
square3.Erase(winHandle);
square4.Erase(winHandle);
}
/*移动*/
public bool down()
{
//检测是否可以下移
if (GameField.isEmpty(square1.location.X / squareSize, square1.location.Y / squareSize + 1) &&
GameField.isEmpty(square2.location.X / squareSize, square2.location.Y / squareSize + 1) &&
GameField.isEmpty(square3.location.X / squareSize, square3.location.Y / squareSize + 1) &&
GameField.isEmpty(square4.location.X / squareSize, square4.location.Y / squareSize + 1))
{
Erase(GameField.winHandle);
square1.location = new Point(square1.location.X, square1.location.Y + squareSize);
square2.location = new Point(square2.location.X, square2.location.Y + squareSize);
square3.location = new Point(square3.location.X, square3.location.Y + squareSize);
square4.location = new Point(square4.location.X, square4.location.Y + squareSize);
Draw(GameField.winHandle);
return true;
}
else //如果不能下移了
{
GameField.stopSquare(square1, square1.location.X / squareSize, square1.location.Y / squareSize);
GameField.stopSquare(square2, square2.location.X / squareSize, square2.location.Y / squareSize);
GameField.stopSquare(square3, square3.location.X / squareSize, square3.location.Y / squareSize);
GameField.stopSquare(square4, square4.location.X / squareSize, square4.location.Y / squareSize);
return false; //表示可以弹出下一个block了
}
}
public bool left()
{
//检测是否可以左移
if (GameField.isEmpty(square1.location.X / squareSize-1, square1.location.Y / squareSize) &&
GameField.isEmpty(square2.location.X / squareSize-1, square2.location.Y / squareSize) &&
GameField.isEmpty(square3.location.X / squareSize-1, square3.location.Y / squareSize) &&
GameField.isEmpty(square4.location.X / squareSize-1, square4.location.Y / squareSize))
{
Erase(GameField.winHandle);
square1.location = new Point(square1.location.X - squareSize, square1.location.Y);
square2.location = new Point(square2.location.X - squareSize, square2.location.Y);
square3.location = new Point(square3.location.X - squareSize, square3.location.Y);
square4.location = new Point(square4.location.X - squareSize, square4.location.Y);
Draw(GameField.winHandle);
return true;
}
else //如果不能左移了
{
return false;
}
}
public bool right()
{
//检测是否可以右移
if (GameField.isEmpty(square1.location.X / squareSize +1, square1.location.Y / squareSize) &&
GameField.isEmpty(square2.location.X / squareSize +1, square2.location.Y / squareSize) &&
GameField.isEmpty(square3.location.X / squareSize +1, square3.location.Y / squareSize) &&
GameField.isEmpty(square4.location.X / squareSize +1, square4.location.Y / squareSize))
{
Erase(GameField.winHandle);
square1.location = new Point(square1.location.X + squareSize, square1.location.Y );
square2.location = new Point(square2.location.X + squareSize, square2.location.Y);
square3.location = new Point(square3.location.X + squareSize, square3.location.Y);
square4.location = new Point(square4.location.X + squareSize, square4.location.Y);
Draw(GameField.winHandle);
return true;
}
else //如果不能右移了
{
return false;
}
}
/*旋转block*/
public void Rotate()
{
//保存每个小块的位置
Point oldPosition1 = square1.location;
Point oldPosition2 = square2.location;
Point oldPosition3 = square3.location;
Point oldPosition4 = square4.location;
//保存当前的方向
RotateDirections oldRotation = myRotation;
//开始试着旋转方块,旋转方向:顺时针方向 旋转中心点为形状拐点
Erase(GameField.winHandle);
switch(blockType)
{
case BlockTypes.square:
break;
case BlockTypes.line:
//直线的旋转只有两种方向
switch (myRotation)
{
case RotateDirections.North:
myRotation = RotateDirections.East;
square1.location = new Point(square2.location.X-squareSize,square2.location.Y);
square3.location = new Point(square2.location.X+squareSize,square2.location.Y);
square4.location = new Point(square2.location.X + 2 * squareSize, square2.location.Y);
break;
case RotateDirections.East:
myRotation = RotateDirections.North;
square1.location = new Point(square2.location.X,square2.location.Y-squareSize);
square3.location = new Point(square2.location.X, square2.location.Y +squareSize);
square4.location = new Point(square2.location.X, square2.location.Y + 2 * squareSize);
break;
}
break;
case BlockTypes.J:
//J形方块有四种旋转方向
switch (myRotation)
{
case RotateDirections.North:
myRotation = RotateDirections.East;
square1.location = new Point(square3.location.X+2*squareSize,square3.location.Y);
square2.location = new Point(square3.location.X+squareSize,square3.location.Y);
square4.location = new Point(square3.location.X,square3.location.Y-squareSize);
break;
case RotateDirections.East:
myRotation = RotateDirections.South;
square1.location = new Point(square3.location.X,square3.location.Y+2*squareSize);
square2.location = new Point(square3.location.X,square3.location.Y+squareSize);
square4.location = new Point(square3.location.X+squareSize,square3.location.Y);
break;
case RotateDirections.South:
myRotation = RotateDirections.West;
square1.location = new Point(square3.location.X-2*squareSize,square3.location.Y);
square2.location = new Point(square3.location.X-squareSize,square3.location.Y);
square4.location = new Point(square3.location.X,square3.location.Y+squareSize);
break;
case RotateDirections.West:
myRotation = RotateDirections.North;
square1.location = new Point(square3.location.X,square3.location.Y-2*squareSize);
square2.location = new Point(square3.location.X,square3.location.Y-squareSize);
square4.location = new Point(square3.location.X-squareSize,square3.location.Y);
break;
}
break;
case BlockTypes.L:
//L形方块有四种旋转方向
switch (myRotation)
{
case RotateDirections.North:
myRotation = RotateDirections.East;
square1.location = new Point(square3.location.X+2*squareSize,square3.location.Y);
square2.location = new Point(square3.location.X+squareSize, square3.location.Y);
square4.location = new Point(square3.location.X, square3.location.Y+squareSize);
break;
case RotateDirections.East:
myRotation = RotateDirections.South;
square1.location = new Point(square3.location.X, square3.location.Y + 2 * squareSize);
square2.location = new Point(square3.location.X, square3.location.Y + squareSize);
square4.location = new Point(square3.location.X - squareSize, square3.location.Y);
break;
case RotateDirections.South:
myRotation = RotateDirections.West;
square1.location = new Point(square3.location.X - 2 * squareSize, square3.location.Y);
square2.location = new Point(square3.location.X - squareSize, square3.location.Y);
square4.location = new Point(square3.location.X, square3.location.Y - squareSize);
break;
case RotateDirections.West:
myRotation = RotateDirections.North;
square1.location = new Point(square3.location.X, square3.location.Y - 2 * squareSize);
square2.location = new Point(square3.location.X, square3.location.Y - squareSize);
square4.location = new Point(square3.location.X + squareSize, square3.location.Y);
break;
}
break;
case BlockTypes.T:
//T形方块也有四种旋转方向
switch (myRotation)
{
case RotateDirections.North:
myRotation = RotateDirections.East;
square1.location = new Point(square2.location.X,square2.location.Y-squareSize);
square3.location = new Point(square2.location.X, square2.location.Y+squareSize);
square4.location = new Point(square2.location.X-squareSize, square2.location.Y);
break;
case RotateDirections.East:
myRotation = RotateDirections.South;
square1.location = new Point(square2.location.X+squareSize, square2.location.Y);
square3.location = new Point(square2.location.X-squareSize, square2.location.Y);
square4.location = new Point(square2.location.X, square2.location.Y-squareSize);
break;
case RotateDirections.South:
myRotation = RotateDirections.West;
square1.location = new Point(square2.location.X, square2.location.Y+squareSize);
square3.location = new Point(square2.location.X, square2.location.Y-squareSize);
square4.location = new Point(square2.location.X+squareSize, square2.location.Y);
break;
case RotateDirections.West:
myRotation = RotateDirections.North;
square1.location = new Point(square2.location.X-squareSize, square2.location.Y);
square3.location = new Point(square2.location.X+squareSize, square2.location.Y);
square4.location = new Point(square2.location.X, square2.location.Y+squareSize);
break;
}
break;
case BlockTypes.Z:
//Z形方块有两种旋转方向
switch (myRotation)
{
case RotateDirections.North:
myRotation = RotateDirections.East;
square1.location = new Point(square2.location.X, square2.location.Y - squareSize);
square3.location = new Point(square2.location.X - squareSize, square2.location.Y);
square4.location = new Point(square2.location.X - squareSize, square2.location.Y + squareSize);
break;
case RotateDirections.East:
myRotation = RotateDirections.North;
square1.location = new Point(square2.location.X-squareSize, square2.location.Y);
square3.location = new Point(square2.location.X, square2.location.Y+squareSize);
square4.location = new Point(square2.location.X+squareSize, square2.location.Y+squareSize);
break;
}
break;
case BlockTypes.S:
//S形方块有两种旋转方向
switch (myRotation)
{
case RotateDirections.North:
myRotation = RotateDirections.East;
square1.location = new Point(square3.location.X+squareSize,square3.location.Y+squareSize);
square2.location = new Point(square3.location.X+squareSize, square3.location.Y);
square4.location = new Point(square3.location.X, square3.location.Y-squareSize);
break;
case RotateDirections.East:
myRotation = RotateDirections.North;
square1.location = new Point(square3.location.X-squareSize, square3.location.Y+squareSize);
square2.location = new Point(square3.location.X, square3.location.Y+squareSize);
square4.location = new Point(square3.location.X+squareSize, square3.location.Y);
break;
}
break;
}
//旋转之后检测位置是否冲突
if (!(GameField.isEmpty(square1.location.X / squareSize, square1.location.Y / squareSize)&&
GameField.isEmpty(square2.location.X / squareSize, square2.location.Y / squareSize)&&
GameField.isEmpty(square3.location.X / squareSize, square3.location.Y / squareSize)&&
GameField.isEmpty(square4.location.X / squareSize, square4.location.Y / squareSize)))
{//如果有冲突则回到原来的状态
myRotation = oldRotation;
square1.location = oldPosition1;
square2.location = oldPosition2;
square3.location = oldPosition3;
square4.location = oldPosition4;
}
Draw(GameField.winHandle);
}
/*检测是否到顶*/
public int Top()
{
return Math.Min(square1.location.Y,Math.Min(square2.location.Y,Math.Min(square3.location.Y,square4.location.Y)));
}
}
}
2013-01-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人