2010年1月22日 星期五

更改遠端桌面 PORT

遠端桌面port在tcp中的預設是3389
因為大家的電腦內建都是如此,所以容易被入侵(如果你的電腦有入侵價值的話)
所以來介紹一下改遠端port的方法:
1.開始>執行>regedit>enter
2.找到HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\Wds\Repwd\Tds\Tcp 中的PortNumber>右鍵>修改>點選十進位,然後改成自己想要的數字,四位數比較好
3.再找到HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp 中的PortNumber>右鍵>修改>點選十進位,然後改成剛剛設定的四位數
4.控制台>防火牆>例外>新增連接阜>新增剛剛設定的port>確定
5.最後,記得當你要遠端連線的時候,要在自己的ip後面加上":xxxx" 就像之前寫jsp時要加上":8080:一樣。 例如你的ip是140.123.45.78,port設1234 那遠端時就要輸入:140.123.45.78:123 這樣~相信聰明的大家都會了吧~

2010年1月11日 星期一

讓window mobile 播放MP3 用 vb.net


Imports System.Runtime.InteropServices

Public Class Form1

_
Private Shared Function SndPlaySync(ByVal Path As String, ByVal Flags As UInteger) As IntPtr
End Function

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim ii As Integer

ii = SndPlaySync("\Storage Card\音樂\2008-12-12 梁文音 - 愛的詩篇\01. 最幸褔的事.mp3", 0)
End Sub



End Class

2009年11月26日 星期四

vb.net 、C# 網頁上applet






所以這叫做vb.net applet? OR C# applet?






有圖有真相










此開發環境為 windows XP 、VS 2008





VB版:





1. 建立 Windows Form 使用者控制項:










2.編譯的標籤,勾選..
『註冊OCM....』









3.在程式裡面,需要在一開使的地方做一些調整







是的,需要Import System...................



跟加上Guid、ComVisible



還有主要的 Class要繼承 UserControl

4.在AssemblyInfo.vb裡面





要加上














5.把您的超級程式碼擺進去吧。。。




..................................................






6.高興的按下三角形編譯吧





7.這個時候HTML需要製作了



OK,大功告成...

C#版的話,自行想像。。。基本上很相近

2009年10月30日 星期五

溫室裡的工程師

在矽X寫第一隻程式的時候,突然想起如果是有幾百萬筆資料,他們會怎麼想,如果使用者亂拉資料,DB Server不怕Crash掉嗎?根據溝通的結果。。。。他們說。。。銀行也只會調今年的資料,我反問說,萬一,櫃台小姐想調出5年前的交易紀錄,怎麼辦

PS.資料很有可能很大(如果每次都SELECT *....沒幾個人玩,DB Server記憶體要擴充到幾百G都有可能...)

他們:........

我:!!(。。。)

好吧,我自己想,在艾瑞克也是這樣解的。。。很多無解的問題也是這樣解的

2009年9月25日 星期五

3D座標轉2D座標

3D轉2D?聽起來很簡單。可是發現裡面牽涉一堆陣列的時候頭就痛
這是研究結果
Vector3 screenSpace = graphics.GraphicsDevice.Viewport.Project(
Vector3.Zero, cameraProjectionMaxtrix, cameraViewMaxtrix, new Matrix(0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.1f, 0.0f
, ship.position.X, ship.position.Y, ship.position.Z, 1.0f));

座標就在這裡出現
screenSpace.X ←怪物的X座標
screenSpace.Y ←怪物的Y座標

利用此座標,在怪物或是機械死亡的瞬間,繪出爆炸效果,就是爆破了

2009年9月22日 星期二

XNA畫線


介紹一下XNA劃線功能,vb劃線很簡單 System.DrawLine(參數自己查...)
,可是XNA卻搞一堆鬼東西,明明號稱『123,站著寫真簡單』,真是不簡單
不廢話,以下為source code 自己抄
namespace DrawLine1
{
///
/// This is the main type for your game
///

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


VertexPositionNormalTexture[] line; // Our start and end points.
Matrix world, projection, view; // Transformation Matrices
BasicEffect basicEffect; // Standard Effect to draw with
VertexDeclaration vertexDeclaration; // Our format for the line.
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}

///
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
///

protected override void Initialize()
{
// TODO: Add your initialization logic here
InitializeTransforms();
InitializeBasicEffect();
base.Initialize();
}
private void InitializeTransforms()
{
world = Matrix.CreateTranslation(new Vector3(-1.5f, -0.5f, 0.0f));
view = Matrix.CreateLookAt(
new Vector3(0.0f, 0.0f, 7.0f),
new Vector3(0.0f, 0.0f, 0.0f),
Vector3.Up
);
projection = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(45),
(float)graphics.GraphicsDevice.Viewport.Width /
(float)graphics.GraphicsDevice.Viewport.Height,
1.0f, 100.0f);
}
///
/// Setup up the required effect so we can see our scene
///

private void InitializeBasicEffect()
{
// Not part of the Effect per se, but is required for drawing
vertexDeclaration = new VertexDeclaration(
graphics.GraphicsDevice,
VertexPositionNormalTexture.VertexElements
);
basicEffect = new BasicEffect(graphics.GraphicsDevice, null);
basicEffect.DiffuseColor = new Vector3(1.0f, 1.0f, 1.0f);
basicEffect.World = world;
basicEffect.View = view;
basicEffect.Projection = projection;
}
///
/// LoadContent will be called once per game and is the place to load
/// all of your content.
///

protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);

// TODO: use this.Content to load your game content here
}

///
/// UnloadContent will be called once per game and is the place to unload
/// all content.
///

protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}

///
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
///

/// Provides a snapshot of timing values.
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();

// TODO: Add your update logic here

base.Update(gameTime);
}
private void DrawLine()
{
line = new VertexPositionNormalTexture[2];
line[0] = new VertexPositionNormalTexture(new Vector3(0, 0, 0),
Vector3.Forward,
Vector2.One
);
line[1] = new VertexPositionNormalTexture(new Vector3(0, 1, 0),
Vector3.Forward,
Vector2.One
);
graphics.GraphicsDevice.DrawUserIndexedPrimitives(
PrimitiveType.LineList,
line,
0, // vertex buffer offset to add to each element of the index buffer
2, // number of vertices in pointList
new short[2] { 0, 1 }, // the index buffer
0, // first index element to read
1 // number of primitives to draw
);
}
///
/// This is called when the game should draw itself.
///

/// Provides a snapshot of timing values.
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
graphics.GraphicsDevice.VertexDeclaration = vertexDeclaration;
// The effect is a compiled effect created and compiled elsewhere
// in the application.
basicEffect.Begin();
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Begin();
DrawLine();
pass.End();
}
basicEffect.End();
// TODO: Add your drawing code here

base.Draw(gameTime);
}
}
}

2009年9月14日 星期一

打飛碟









目前進度:
機關槍
打到會爆炸
用滑鼠瞄準目標
滑鼠滾輪縮放
標示目前使用的武器
武器攻擊力、速度、冷卻時間設定
敵人爆炸會振動
進度棒
切換武器按鈕
未完成:
主選單
劇情
增加子砲塔


ps.為什麼我的工作不是寫遊戲。。。。