简单介绍:
* 更新了批量更新功能;
* 更新了任务栏显示功能;
* 主要功能有,单词查询,单词读音,
* 支持热键Ctrl + "+"号,显示或隐藏界面,方便随时调用
* 查询"+" + 单词首字母,查看数据更新情况,如查询"+a",则显示"查询到XXX条以a开头的单词"
* 修复了每次查询都需要联机的错误,直接查询本地数据,使得查询速度更快,
* 修复了现有数据路径的算法,
* 再次声明,本软件数据全部来自
www.dict.cn网站,请勿商用,以免造成不必要的麻烦,
* 软件本身您可以无限制的使用,完全免费且开放源代码,源码可以
http://kkun.cnblogs.com下载
* 软件运行需要.NET2.0框架支持,
* 完全绿色安装,解压缩即可使用,不写注册表,没有插件,不更改客户机的任何现有设置,
* 从事软件开发很多年,这是偶第一次发布自己开发的软件,请多多支持,任何建议,交流或BUG请联系:
hebkkun@163.com
* 再次感谢下载,祝您使用愉快!
软件界面:

主界面,Enter键查询或播放声音,ESC键清空输入框或关闭窗口

点击随机获取文章,将从
http://www.unsv.com随机获取一篇VOA,然后点击分析"按钮"后,会分析文章中所有在本地不存在的单词,将这些单词放在一个LISTBOX中,点击更新将依次更新到本地,方便建库.暂停功能就不介绍了.
自动更新目前还有些小BUG,就是如果子线程正在往硬盘上写数据的时候,
关闭主窗口,则会报错.那位朋友有这方面的经验劳烦指点一下,感激不尽!
数据存储:
原来是使用SQL存储数据的,后来一度想使用ACCESS,考虑到性能及部署,最终选择将数据直接存储在硬盘上
声明:本软件所有使用的数据均来自
www.dict.cn,请勿商用其数据,以免造成不必要的麻烦,
下载地址:
软件大小(
2586 KB),地址已经更新(2008-1-29 13:01)
每次查询会将查询到的数据自动保存到本地
http://www.cnblogs.com/Files/kkun/Release.rar
源码下载:
http://www.cnblogs.com/Files/kkun/App,Dict,Lib,32.rar
如果打开项目时提示需要输入密码,请输入
624159,很不好意思,今天有园子里的朋友问了这才想起来了,
其它:
非常荣幸,华军将此软件收录,
http://www.baidu.com/s?wd=%B5%A5%B4%CA%B2%E9%D1%AF%D0%A1%C8%ED%BC%FE&cl=3
http://www.onlinedown.net/soft/63860.htm
posted @
2008-01-24 17:46 kkun 阅读(586) |
评论 (8) |
编辑
开源[代码自动生成小软件],测试中,广征建议
下载地址:
svn://svnhost.cn/CodeCreate
顺便请教几个问题,
问题1,现在生成代码使用的模板+标签替换
是否有更好的解决方法?
问题2,如果需要创建自动SQL的实体,如何实现?使用视图还是表变量,临时表等方法?或者其它办法?
问题3,每个实体都有对应的实体集合类,
是否可以用泛型来优化?如何优化?
问题4,BUSINESS逻辑层全部使用静态方法有什么优点和缺点?
问题5,如何完美的实现从SqlDbType 到 System.Type的互换,
问题6,请看完代码后,找出其中设计不足的地方,最好能够给出修改建议
posted @
2008-05-11 12:32 kkun 阅读(36) |
评论 (0) |
编辑
This article leads you through the steps necessary to create a simple sprite-based game by using XNA Game Studio.
The Complete Sample
这篇文章介绍了如何使用XNA工具,通过以下几步创建一个简单的游戏,
Step 1: Install Your Software
Step 2: Create a New Project
Step 3: View the Code
Step 4: Add a Sprite
Step 5: Make the Sprite Move and Bounce
Step 6: Explore!
1,安装软件,
2,创建一个项目
3,查看生成的代码
4,添加精灵
5,让精灵动起来,遇到边界自动反弹
6,运行游戏
The Complete Sample
The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample.
完整的例子
文章中的代码实例讲解了这些技术,你可以下载到完整的代码,包括例子中用到的所有文件,
Download MyFirstGame_Tutorial_Sample.zip.
Step 1: Install Your Software
Before you begin, make sure that you have installed all the necessary software, including a supported version of Microsoft Visual Studio tools and XNA Game Studio. See
Required Software for a list of required programs.
第一步,安装软件
开始之前,请确认你已经安装了所有必需的软件,包括Micorsoft Visual Studio和XNA Game Studio受支持的版本,点击此处查看要求的软件列表
Step 2: Create a New Project From the
Start menu, click
All Programs, then the
Microsoft XNA Game Studio 2.0 folder, and finally click your supported version of Microsoft Visual Studio tools. When the Start Page appears, click the
File menu, and then click
New Project. A dialog box will appear with a tree list on the left pane, marked Project Types. Select the
XNA Game Studio 2.0 tree node underneath the
Visual C# node. A set of available projects will appear in the right pane.
第二步,创建项目
从开始菜单,点击所有程序,选择Microsoft XNA Game Studio 2.0,最后选择受支持的版本的Micorsoft Visual Studio,
出现开始界面时,点击菜单中的文件,点击新项目,这时出现一个对话框,左侧是各种项目,选择C#节点下边的XNA Game Studio 2.0项目,一套可用的项目将会在对话框的右边列出,
In the right pane of the dialog box that appears, choose
Windows Game (2.0) and type a title for your project (such as "MyFirstGame") in the
Name box. Type a path where you'd like to save your project in the
Location box. Then click
OK.After creating a new project, you'll be presented with the code view of your game.
在右边的对话框中选择Windows Game (2.0),在项目名称栏中输入项目的标题(如"MyFirstGame"),在存储位置中输入项目保存的地址,点击确定.项目创建完毕后,你可以看到默认打开的代码页
Step 3: View the Code
Some of the hard work has already been done for you. If you build and run your game now, the
GraphicsDeviceManager will handle setting up your screen size and rendering a blank screen. Your game will run and update all by itself. It's up to you to insert your own code to make the game more interesting.
第三步,查看代码
一些重复性的工作已经自动创建好了,此时如果你编译运行的话,GraphicsDeviceManager会设置你的屏幕的大小并沉浸一个空窗口,这个窗口将运行并自动更新,是插入你自己的代码的时候了,让它更有趣一些.
Much of the code to start and run your game has already been written for you, and all have places for you to insert your code.
运行它的代码大部分已经写好,并且都留出了添加你自己代码的地方,
- The Initialize method is where you can initialize any assets that do not require a GraphicsDevice to be initialized.
- The LoadContent method is where you load any game assets your game needs, such as models and textures.
- The UnloadContent method is where any game assets can be released. Generally, no extra code is required here, as assets will be released automatically when they are no longer needed.
- The Update loop is the best place to update your game logic: move objects around, take player input, decide the outcome of collisions between objects, and so on.
- The Draw loop is the best place to render all of your objects and backgrounds on the screen.
- Initialize方法里,你可以初始化所有不需要GraphicsDevice的东东,
- LoadContent方法里,可以加载游戏中的资源,如模型和纹理等
- UnloadContent方法与LoadContent刚好相反,是释放这这些资源的地方,一般情况下,这里不需要额外的代码,如果这些资源长时间不使用的话会自动释放.
- Update循环方法是放置游戏逻辑的最好的地方,移动物体,接收玩家的输入,检测到两个物体碰撞时的输出等,
- Draw循环方法是渲染所有物体和背景到屏幕上的地方,
Step 4: Add a Sprite
The next step is to add a graphic that can be drawn on the screen. Use a small graphics file, such as a small .bmp or .jpg file. Be creative—you can even make your own.
第四步,添加精灵
下一步将添加一个图片并输出到屏幕上,使用一个小图片文件,如.bmp,.jpg,你也可以自己制作一张
- You can even skip ahead a bit and make a sprite that "hides" parts that should not be seen (such as edges or corners) so that it looks even better.
- 你甚至可以忽略精灵的前景色,这样使精灵的一部分不可见,如边缘或边角部分,这样看上去更好看一些
- Once you have a graphic picked out on your computer, follow these steps.
- 当你选择一张图片的时候,按照下边的步骤
- Make sure you can see the Solution Explorer for your project on the right side of the window. If you cannot see it, click the View menu, and then click Solution Explorer. When it appears, you will see files associated with your project in a tree structure.
- 确认你现在可以看到项目右边的解决方案资源管理器,如果你看不到它,点击菜单中的查看,点击解决方案资源管理器,这时就会出现了,你可以在树型列表中看到这些已经声明过的文件
- Inside the tree, you will see a node named Content. Right-click this node, click Add, and then click Existing Item. Browse to your graphic. If you can't see any files, make sure you change the Files of type selection box to read Texture Files. Click the graphic file, then click Add. An entry for the graphic file will appear in Solution Explorer.
- 在这个树型列表里,你可以看到一个叫做Content的节点,右键这个节点,点击添加,添加现有项,找到你的图片,如果你看不到文件,请确认对话框中的文件类型,选择你的图片文件,点击确定添加,图片文件将会出现在解决方案的列表中
- When you add a graphic file, it is automatically added to the XNA Framework Content Pipeline, which will allow you to quickly and easily load the graphic into your game.
- 当你添加图片的时候,它会自动添加一个XNA Framework Content Piptline,这样你就可以快速方便的将图片加载到你的游戏中了,
- Click the entry for the graphic in the Solution Explorer. If you do not see the entry, ensure the Content node is expanded by clicking the small plus sign (+) to the left of the node, then click on the entry that appears underneath the Content node.
- In the Properties window below Solution Explorer, look for the "Asset Name" property. Note the name; you'll use it in your code to load the graphic so it can be displayed in your game. If the Properties window is not visible, press F4, or click the View menu, and then click Properties Window.
- 在解决方案资源管理器中点击这张图片,如果你看不到它请确认Content节点是展开的,点击它左边的小加号(+)就可以,这时点击Content节点下边的这张图片,在解决方案资源管理器的下边有一个属性窗口,找到"Asset Name"属性,给它命名,然后就可以在程序加载它并在你的游戏里边显示了.如果你找不到属性窗口,按F4键,或者点击查看菜单,选择属性窗口,
- Now, you must write code that loads and displays the sprite on the screen. You can use the instructions in How To: Draw a Sprite, or follow along here.
- 好了,你现在必须写一些代码,加载这个精灵并让它显示在屏幕上,你可以查看"How To"中的Draw a Sprite,或者继续往下看
Back in the Code view of your game, find the
LoadContent method, and add the following lines in and above the method so it looks similar to this:
回到游戏的代码页,找到LoadContent方法,添加代码如下所示
C#
// This is a texture we can render.
Texture2D myTexture;

// Set the coordinates to draw the sprite at.
Vector2 spritePosition = Vector2.Zero;

protected override void LoadContent()


{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
myTexture = Content.Load<Texture2D>("mytexture");
}
Make sure the call to ContentManager.Load is using the "Asset Name" you saw in the Properties window in the previous step.
This code will load and prepare your graphic to be drawn, and will reload your graphic if the graphics device is reset (such as in the case of the game window being resized).
确认ContentManager.Load方法使用的参数是你上一步在"Asset Name"中命名的资源,这些代码将加载你的图片并准备画到屏幕上去,在你的图片设备重置(如当游戏窗口改变大小后)时会自动重新加载
Now, add code to the
Draw loop so it looks like this:
在Draw循环中添加以下代码,
C#
protected override void Draw(GameTime gameTime)


{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
// Draw the sprite.
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
spriteBatch.Draw(myTexture, spritePosition, Color.White);
spriteBatch.End();

base.Draw(gameTime);
}
This code draws the sprite on the screen each frame.
这段代码在屏幕上显示这个精灵,
- Build and run your game. The sprite appears. Now, it's time to give it some motion.
- 编译运行你的游戏,这个精灵显示出来了,好了,现在是时候让它动起来了,
Step 5: Make the Sprite Move and Bounce Change the lines of code in and above the
Update method to read this way:
第五步,让精灵动起来并自动反弹,将代码切换到Update方法,添加以下函数,
C#
// Store some information about the sprite's motion.
Vector2 spriteSpeed = new Vector2( 50.0f, 50.0f );

protected override void Update(GameTime gameTime)


{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();

// Move the sprite around.
UpdateSprite(gameTime);

base.Update(gameTime);
}

void UpdateSprite(GameTime gameTime)


{
// Move the sprite by speed, scaled by elapsed time.
spritePosition += spriteSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;

int MaxX = graphics.GraphicsDevice.Viewport.Width - myTexture.Width;
int MinX = 0;
int MaxY = graphics.GraphicsDevice.Viewport.Height - myTexture.Height;
int MinY = 0;

// Check for bounce.
if (spritePosition.X > MaxX)

{
spriteSpeed.X *= -1;
spritePosition.X = MaxX;
}

else if (spritePosition.X < MinX)

{
spriteSpeed.X *= -1;
spritePosition.X = MinX;
}

if (spritePosition.Y > MaxY)

{
spriteSpeed.Y *= -1;
spritePosition.Y = MaxY;
}

else if (spritePosition.Y < MinY)

{
spriteSpeed.Y *= -1;
spritePosition.Y = MinY;
}
}
This adds a little bit of logic that will move the sprite around each frame and cause the sprite to change direction if it hits the edges of the game window.
这里添加了一些很小的逻辑判断,精灵在每侦中移动,并在碰到窗口的边缘时自动更改方向
Step 6: Explore!
From here, you can do just about anything. If you're ready to jump into a more complex example, including 3D graphics, input, and audio, see
Going Beyond: XNA Game Studio in 3D.
第六步,运行
在这里,你基本没有什么工作要做了,如果你准备去看一些复杂些的例子,包括3D图形,输入和声音,可以看:XNA Game Studio in 3D.
Here are some more ideas to extend this sample:
这里有一些方法去扩展这个例子
Experiment with the call to
SpriteBatch.
Draw. Change the Color parameter to tint the sprite. See
How To: Tint a Sprite. Add a second sprite, and use
BoundingBox objects to allow the sprites to collide with one another. (See
How To: Detect Whether Two Models Collide.)
试着用SpriteBatch.Draw方法,改变精灵的颜色参数,参考How To: Tint a Sprite.
添加两个精灵,使用BoundingBox让两个精灵互相碰撞,参考Detect Whether Two Models Collide.
Use
Keyboard,
Mouse, or
GamePad to make the sprite respond to movements of an input device. (See
Input Overview.)
Create some audio events so that the sprite makes sounds as it moves. (See
How To: Add a Sound File to Your Game Using XACT and How To: Play a Sound.)
使用键盘,鼠标或者GamePad使精灵响应输入操作,参考 Input Overview
创建一些声音事件,当它运行时制造一些声音,参考Add a Sound File to Your Game Using XACT and How To: Play a Sound.
Instead of a sprite, use a 3D primitive that moves around in 3D space. (See
How To: Draw Points, Lines, and Other 3D Primitives.)
使用3D取代精灵,并在3D空间中移动
Get more ideas and resources at
XNA Creators Club Online.
更多的方法和资源请访问XNA Creators Club Online.
//第一次翻译外文并发表,翻译得不好,献丑了
posted @
2008-02-25 17:00 kkun 阅读(178) |
评论 (0) |
编辑
今天想试试XNA2.0好玩不好玩,结果上来就遇到难题,从网上DOWN下来XNA STUDIO后安装一切顺利,
之后安装了DX9,一切顺利,新建一个项目,运行,报错!
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
网上先查一查,结果中文资料好少,从一些网站了解到,是由于显示太老,给出的答案是:换显卡;
后来搜到
一篇文章中提到,可以更改渲染方式,指定为软件模拟而不使用硬件,由于以前研究过一段时间DX,
感觉这应该是个解决的办法,当然最终还是依靠这个思路解决的,这篇文章并没有最终解决问题的代码,但是也帮了不少的忙,
先看最初的代码吧,

public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;


public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
这里只贴出了部分代码,就是构造一个Game1,然后执行

static class Program
{

/**//// <summary>
/// The main entry point for the application.
/// </summary>

static void Main(string[] args)
{

using (Game1 game = new Game1())
{
game.Run();
}
}
然后就报错了,如题目描述;
为了使用软件渲染,将代码修改如下

public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;


public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
}


void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
e.GraphicsDeviceInformation.CreationOptions = CreateOptions.SoftwareVertexProcessing;
e.GraphicsDeviceInformation.DeviceType = DeviceType.Reference;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType = MultiSampleType.None;
}
F5执行,直接提示我,
错误 2 当前上下文中不存在名称“CreateOptions” E:"WindowsGame1"WindowsGame1"Game1.cs 27 67 WindowsGame1
又从网上搜索,发现此方法已经被Removed,将其注释掉编译通过,
F5执行,提示
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
晕,这不又回到原点了么,
后来调试发现,此方法似乎并没有执行,为什么没有执行呢?我也没兴趣研究下去了,现在我只想运行出一个窗口来!
终于在
一个国外的网站上发现了一个好东西,
ReferenceGraphicsDeviceManager
这个东西基本可以解决问题了,新建一个类ReferenceGraphicsDeviceManager,然后将GraphicsDeviceManager替换为ReferenceGraphicsDeviceManager,再次编译,报错,这个类的作者在写的时候XNA2.0应该还没出呢,于是这次都是一些版本上的错误,一一修改后,编译通过,F5运行...
通过,将此代码上传,希望对此有研究的高人表笑话,如果此文对您有些许帮助,荣幸之极,
本人在此过程中仅仅充当了一个finder角色,一些东西还停留在学习的阶段,共同进步吧!
/Files/kkun/ReferenceGraphicsDeviceManager.rar
posted @
2008-02-21 15:15 kkun 阅读(372) |
评论 (0) |
编辑
简单介绍:
* 更新了批量更新功能;
* 更新了任务栏显示功能;
* 主要功能有,单词查询,单词读音,
* 支持热键Ctrl + "+"号,显示或隐藏界面,方便随时调用
* 查询"+" + 单词首字母,查看数据更新情况,如查询"+a",则显示"查询到XXX条以a开头的单词"
* 修复了每次查询都需要联机的错误,直接查询本地数据,使得查询速度更快,
* 修复了现有数据路径的算法,
* 再次声明,本软件数据全部来自
www.dict.cn网站,请勿商用,以免造成不必要的麻烦,
* 软件本身您可以无限制的使用,完全免费且开放源代码,源码可以
http://kkun.cnblogs.com下载
* 软件运行需要.NET2.0框架支持,
* 完全绿色安装,解压缩即可使用,不写注册表,没有插件,不更改客户机的任何现有设置,
* 从事软件开发很多年,这是偶第一次发布自己开发的软件,请多多支持,任何建议,交流或BUG请联系:
hebkkun@163.com
* 再次感谢下载,祝您使用愉快!
软件界面:

主界面,Enter键查询或播放声音,ESC键清空输入框或关闭窗口

点击随机获取文章,将从
http://www.unsv.com随机获取一篇VOA,然后点击分析"按钮"后,会分析文章中所有在本地不存在的单词,将这些单词放在一个LISTBOX中,点击更新将依次更新到本地,方便建库.暂停功能就不介绍了.
自动更新目前还有些小BUG,就是如果子线程正在往硬盘上写数据的时候,
关闭主窗口,则会报错.那位朋友有这方面的经验劳烦指点一下,感激不尽!
数据存储:
原来是使用SQL存储数据的,后来一度想使用ACCESS,考虑到性能及部署,最终选择将数据直接存储在硬盘上
声明:本软件所有使用的数据均来自
www.dict.cn,请勿商用其数据,以免造成不必要的麻烦,
下载地址:
软件大小(
2586 KB),地址已经更新(2008-1-29 13:01)
每次查询会将查询到的数据自动保存到本地
http://www.cnblogs.com/Files/kkun/Release.rar
源码下载:
http://www.cnblogs.com/Files/kkun/App,Dict,Lib,32.rar
如果打开项目时提示需要输入密码,请输入
624159,很不好意思,今天有园子里的朋友问了这才想起来了,
其它:
非常荣幸,华军将此软件收录,
http://www.baidu.com/s?wd=%B5%A5%B4%CA%B2%E9%D1%AF%D0%A1%C8%ED%BC%FE&cl=3
http://www.onlinedown.net/soft/63860.htm
posted @
2008-01-24 17:46 kkun 阅读(586) |
评论 (8) |
编辑