Just RUN

A scientist builds in order to learn; an engineer learns in order to build.

2006年5月12日 #

Database access assembly build program.

根据数据库结构动态创建配件的程序:

1、根据表结构动态创建数据类;
2、创建基本的数据库操作接口;
3、创建一个工厂类,用以动态创建接口的实现;
4、创建一个默认的SQL Server操作实现;
5、所有的类,直接编译成 .NET Framework 2.0 的配件。

为方便自己工作写的一个小程序,目前还有很多错误,慎用。

用法:

打开配置文件,重设连接字符串,连接字符串不要包含默认数据库信息,并以";"结束,在程序里根据选择拼进默认数据库信息。

注意:

数据库命名,数据库名大写字母开头,表名大写字母开头不能包含空格,和非英文字符,表中第一个字段为"表名+Id",在默认的实现中,这个字段为identity列。

运行要求:

.NET Framework 2.0

配件输出:

目前默认输出于 ".\Builded" 目录下。

 

posted @ 2006-05-12 19:23 阮 阅读(239) | 评论 (1)编辑

2005年7月19日 #

Remoting: Server encountered an internal error.

http://dotnetjunkies.com/WebLog/chris.taylor/articles/5566.aspx

RemotingConfiguration.Configure("TestServer.exe.config");


<?xml version="1.0" encoding="utf-8" ?> 

<configuration> 

  
<system.runtime.remoting>    

    
<customErrors mode="off"/> 

  
</system.runtime.remoting> 

</configuration> 

posted @ 2005-07-19 10:56 阮 阅读(1021) | 评论 (2)编辑

2005年3月21日 #

昨天忽然发现被加到training团队中了,遂来发一篇。

最近也在带几个人,算是新手吧,前天给他们出了一道题给他们思考,现在贴到这里,注意注掉的部分。

答案很明显的,不明白的仔细思考。

using System;
using System.Collections;

namespace Training.Sample
{
    
internal abstract class Vehicle
    
{
//        public override bool Equals(object obj)
//        {
//            return false;
//        }
    }


    
internal class Truck : Vehicle
    
{}

    
public sealed class Sample
    
{
        
public static void Main(string[] args)
        
{
            Vehicle vehicle 
= new Truck();

            ArrayList vehicles 
= new ArrayList();

            vehicles.Add(vehicle);

            Truck truck 
= vehicle as Truck;
//            Truck truck = (Truck) vehicle;

            Console.WriteLine(vehicles.Contains(truck));

            Console.ReadLine();
        }

    }

}

posted @ 2005-03-21 16:18 阮 阅读(2119) | 评论 (0)编辑

2005年3月2日 #

利用Brush修改图片,并写入Response一例(网上BBS中贴可变文字图片的例子)。

经常溜达BBS的人应该都知道,贴个小金牌,上面写上某某某的文字。

也许这个怎么做的早已不是什么秘密了。

今天贴一个ASP.NET版的实现方式,想想在以前ASP的时候是多么遥远的事情啊,转载请注明出处。

        private void Page_Load(object sender, System.EventArgs e)
        
{
            
string drawString = this.Request["String"];

            Font drawFont 
= new Font("@华文行楷", 16f);

            SolidBrush drawBrush 
= new SolidBrush(Color.White);

            
float x = 20f;
            
float y = 20f;

            StringFormat drawFormat 
= new StringFormat();

            drawFormat.FormatFlags 
= StringFormatFlags.DirectionVertical;

            Bitmap bitmap 
= (Bitmap) Bitmap.FromFile("F:\\Golf.jpg");

            Graphics graphics 
= Graphics.FromImage(bitmap);

            graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);

            
this.Response.ContentType = "image/JPEG";

            bitmap.Save(
this.Response.OutputStream, ImageFormat.Jpeg);
        }


效果图:

posted @ 2005-03-02 10:57 阮 阅读(3264) | 评论 (7)编辑

2005年1月24日 #

Avalon 与 3D。

    很早之前就知道avalon有3D支持,尤其那个球的Demo,http://blogs.msdn.com/danlehen/archive/2004/06/01/146259.aspx,前几天刚刚下到CTP,Win FX SDK中的3D例子很少,而且不怎么好用,就目前对xaml的认识还不足以改正其中的错误,无奈,只好再寻例子了,上周末找了半天,终于找到了,在一个录像中照扒下来的。

   
<Window x:Class="AvalonApp.Window1"
    xmlns
="http://schemas.microsoft.com/2003/xaml" xmlns:x="Definition"
    Text
="AvalonApp"
    
>
    
<Viewport3D>
        
<Viewport3D.Camera>
            
<PerspectiveCamera Position="0,0,5" Up="0,1,0" LookAtPoint="0,0,0" FieldOfView="45">
                
<PerspectiveCamera.Position>
                    
<Point3DAnimation From="0,0,5" To="5,5,5" Duration="2" RepeatBehavior="Forever" AutoReverse="true"></Point3DAnimation>
                
</PerspectiveCamera.Position>
            
</PerspectiveCamera>
        
</Viewport3D.Camera>
        
<Viewport3D.Models>
            
<AmbientLight Color="White"></AmbientLight>
            
<GeometryModel3D>
                
<GeometryModel3D.Material>
                    
<BrushMaterial Brush="Blue"></BrushMaterial>
                
</GeometryModel3D.Material>
                
<GeometryModel3D.Geometry>
                    
<MeshGeometry3D
                        
Positions="-1,1,0 1,1,0 1,-1,0 -1,-1,0"
                        TriangleIndices
="0 1 2 0 2 3">
                    
</MeshGeometry3D>
                
</GeometryModel3D.Geometry>
            
</GeometryModel3D>
        
</Viewport3D.Models>
    
</Viewport3D>
</Window>

运行效果如图,视角是移动的。


    这又不禁让我想起了VRML,2年前,我学VRML的时候,就曾经想过,其实VRML应该用XML来写,结果Xaml真的出现了,更出乎意料的是,是MS搞的,那些致力于WEB 3D的公司为什么没有自己把VRML形成XML系列的标准呢,唉,给MS抢了先了。

posted @ 2005-01-24 09:59 阮 阅读(2590) | 评论 (5)编辑

2005年1月21日 #

关于QQ的临时消息

就是指没有添加好友的时候给别人发消息。

我看到很多人都用的http://wpa.qq.com/这个网站上的。

其实根本不用的,安装完QQ之后,在浏览器的地址栏里输入

tencent://Message/?Uin=QQ号码

就可以了,做网页的时候在<A>的 href 中也添这个就可以了。

秘密哦:)

posted @ 2005-01-21 17:14 阮 阅读(1016) | 评论 (0)编辑

Google Search for dot net nuke.

几个月前写的,学习性质的一个DNN模块,由于那时候博客园文件上传比较麻烦,所以就没放过来,一直在DNNCHINA上,现在把它弄这一份:)。

1、到Google上申请一个自己的key;
2、修改Web.config把key填进去;

.
.

    <appSettings>
        
<add key="connectionString" value="Server=localhost;Database=DotNetNuke;uid=;pwd=;" />
        
<add key="GoogleKey" value="mYAFNY9QFHJwLKn+P1XELiqr+SOFtRgr" />
    
</appSettings>
.
.

3、用DNN的FileManager把模块添加进去就可以了。


Download now

posted @ 2005-01-21 09:29 阮 阅读(2638) | 评论 (0)编辑

2005年1月20日 #

初识 Avalon

    其实很早就想看看Avalon,虽然到现在我还不清楚它是什么,今天终于如愿以偿了。

    事情源于一个项目,需要展示展览馆展位情况,我想用VML就得了,一来自己熟,二来IE直接支持,不想事违我愿,非要用SVG,其实我一直对W3C不满,人家用的都好好的,非要自己搞个XX标准,VML到SVG,HTML到XHTML(似乎自己把自己搞翻了),还有就是像博客源BLOG这样的程序,非要用DIV来格式显示,好像HTML不是他们搞的一样,唉,发发牢骚了。没办法,拗不过人家,折腾吧,开始找SVG在.NET下比较好的库什么的,就是这样的意外,我找到了Avalon,似乎八杆子打不到,呵呵,看看这个网站就知道为什么了http://www.mobiform.com/2005/homecontent.htm

    这家公司提供了SVG的库,虽然觉得不怎么样了,主打产品了mobiform本身就是一个Avalon的应用,先把SVG折腾过了,开始弄这个什么mobiform,看看要求

Windows XP with Service Pack 2
.NET 2.0 Beta
Avalon Community Technology Preview

    前两个容易,机器早已安完,后一个就。。。。。。因为我两个月前找这个还没找到,试试看吧,结果还真给我找到了

http://www.microsoft.com/downloads/details.aspx?FamilyID=C8F904E1-B4CA-402B-ACCF-AAA2BD60DA74&displaylang=en

    万事俱备,开始折腾,当我把所有的都安完之后,打开了一个XAML。郁闷了,三个按钮死活不肯出来,无办法,在俺的VPC上接着折腾,说起来真是蹊跷了,由于VPC比较差,我把Theme服务停掉了,露出了丑丑的WIN 2000的按钮,反正出来了,欣喜,呵呵,我有把Theme服务开启了,按钮又害羞了,不肯出来,我恍悟,在自己机器上试了试,果真,由于我装了Stylexp,在非Windows的样式下显示控件有问题,罪魁祸首。

     这样一天就这样折腾过去了,机器实在太慢,都要疯了,开始菜单都爆了,另外有兴趣可以看看mobiform,上面给链接了,说实在的,这个公司做的东西真不怎么样,BUG多多。

<DockPanel xmlns="http://schemas.microsoft.com/2003/xaml">
    
<Border Background="LightBlue"
            DockPanel.Dock
="Top">
        
<Text>Some Text</Text>
    
</Border>
    
    
<Border DockPanel.Dock="Bottom"
            Background
="LightYellow">
        
<Text>Some text at the bottom of the page.</Text>
    
</Border>
    
    
<Border DockPanel.Dock="Left"
            Background
="Lavender">
        
<Text>Some more text</Text>
    
</Border>
    
    
<Border DockPanel.Dock="Fill">
        
<DockPanel>
            
<Button DockPanel.Dock="Top" 
                    Height
="30px"
                    Width
="100px"
                    Margin
="10,10,10,10">Button1</Button>
            
<Button DockPanel.Dock="Top"
                    Height
="30px"
                    Width
="100px"
                    Margin
="10,10,10,10">Button2</Button>
            
<Border DockPanel.Dock="Fill"
                    Background
="LightGreen">
                
<Text >Some Text Below the Buttons</Text>
            
</Border>
        
</DockPanel>
    
</Border>
</DockPanel>

posted @ 2005-01-20 17:58 阮 阅读(2960) | 评论 (4)编辑

2005年1月18日 #

通过程序控制Windows传真发送。

折腾了半天,搞了两个MODEM,终于。。。

下例仅以Jscript实现,其他版本参考可得。

自己记下来也希望对你有帮助^_^。

注意:

    此段代码仅对WinXp有效,Win 2000及Win 98发送方法各不相同;

参考:
    http://members.optusnet.com.au/~hssandler1/VBScript.htm
    http://www.dotnetjunkies.com/Forums/ShowPost.aspx?PostID=2932
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxlegacyvb_836n.asp

///////////////////////////////////////
//
    Title:    Fax send sample code
//
    Date:     2005-1-18
//
    Author:   runmin@tom.com
//
/////////////////////////////////////

//    Get the fax server
var faxServer = new ActiveXObject("FAXCOMEX.FaxServer");

faxServer.Connect(
"");

//    Create a fax document
var doc = new ActiveXObject("FAXCOMEX.FaxDocument");

//    Specify a content file, any printable file.
doc.Body = "C:\\Program Files\\Kingsoft\\Powerword 2003\\Tips.txt";

doc.DocumentName 
= "Fax Test Sample";

//    Recipients
doc.Recipients.Add("820")    //    to fax number here

//    Sender properties
doc.Sender.Name = "mruan"

doc.Sender.FaxNumber 
= "806"    //    from fax number here

//    Send the fax doc
doc.ConnectedSubmit(faxServer)

posted @ 2005-01-18 10:34 阮 阅读(2797) | 评论 (0)编辑

2004年12月30日 #

VRML

        VRML(Virtual Reality Modeling Language)是一种建模语言,也就是说,它是用来描述三维物体及其行为的,可以构建虚拟境界(Virtural World)。VRML的基本目标是建立因特网上的交互式三维多媒体,基本特征包括分布式、三维、交互性、多媒体集成、境界逼真性等。

        浏览器插件安装地址,http://www.parallelgraphics.com/products/cortona,这里只介绍这个插件了。

        一旦安装完成就可以浏览3D造型了。

        网站上的造型:http://www.parallelgraphics.com/showroom/

        3D的游戏:http://www.parallelgraphics.com/showroom/games/,铺铁轨,跳棋,推箱子等等。

        说了这么多,借个花了,呵呵。





posted @ 2004-12-30 10:18 阮 阅读(1219) | 评论 (1)编辑

My Links

Blog Stats

News

与我联系

搜索

 

常用链接

留言簿(9)

我参与的团队

随笔分类

随笔档案

相册

Favorites

最新评论

阅读排行榜

评论排行榜