水如烟

                 顺其自然,水到渠成 LzmTW

文或代码皆是面向初学者.我是爱好者,也是初学者.那些"文章",只按自己理解写,我是不知术语名词的.所以只供参考,也仅供参考.

导航

随笔分类 -  n、HOW TO系列

摘要:Author:水如烟参考了一个C#的,原出处不知在哪了.PublicClassPhysicalDriveDemoPublicSharedSubRun()Console.WriteLine(PhysicalDrive.GetSerialNumber(0))EndSubEndClassImportsSystemImportsSystem.Collections.GenericImportsSystem... 阅读全文

posted @ 2007-02-12 17:12 水如烟(LzmTW) 阅读(2287) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟利用了WScript.Shell示例:NamespaceLzmTW.uSystem.uIOPublicClassShortcutDemo'示例,创建当前程序的快捷方式到桌面PublicSharedSubCreateCurrentAppShortCutOnDesktop()Dimargs(My.Application.CommandLineArgs.Count-1)AsStrin... 阅读全文

posted @ 2007-02-08 12:24 水如烟(LzmTW) 阅读(590) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟以前用过的.不过现在多是用EXCEL打了.那时用在OKI和LQ,两种打印机的控制码是不一样的.要看提供的控制代码说明.那时我是一个个试.ImportsSystem.IOImportsSystem.Runtime.InteropServicesPublicClassDataInfoPrivatemLPTPORTAsString'打印机端口PrivatemInitTextAsStr... 阅读全文

posted @ 2007-02-05 16:26 水如烟(LzmTW) 阅读(599) 评论(1) 推荐(0) 编辑

摘要:重启程序(WinForm) 阅读全文

posted @ 2006-12-21 17:02 水如烟(LzmTW) 阅读(662) 评论(0) 推荐(0) 编辑

摘要:设置默认打印机 阅读全文

posted @ 2006-12-21 12:30 水如烟(LzmTW) 阅读(589) 评论(0) 推荐(0) 编辑

摘要:程序中若打开了一个Workbook给用户直接操作,那么,用户有可能将Workbook关闭了甚至退出了整个ExcelApplicatoin。可以通过以下方法防止这种情形: 阅读全文

posted @ 2006-12-21 09:39 水如烟(LzmTW) 阅读(1648) 评论(3) 推荐(0) 编辑

摘要:Author:水如烟这里所说的网上数据,是基于:一、有固定网址发布最新数据的链接;二、数据格式固定。在去年的10月,曾写了个《全国县及县以上行政区划代码信息类 》见:http://www.cnblogs.com/LzmTW/archive/2005/10/22/260066.html现在仍以行政区划代码数据为例。行政区划代码数据由国家统计局发布,网址为http://www.stats.gov.cn... 阅读全文

posted @ 2006-09-16 18:53 水如烟(LzmTW) 阅读(754) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟现在发现,熟悉NET提供的静态方法是很重要的,不熟悉不熟知,会走好多弯路.当然,走弯路也不是坏事,只是时间有限,经验和技能不能在弯路中积累. 下面的功能是看看指定类所在的程序集究竟公布了哪些静态方法. Imports System.ReflectionPublic Class Form1 Private Sub Button1_Click(ByVal sender As ... 阅读全文

posted @ 2006-08-17 13:42 水如烟(LzmTW) 阅读(343) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟HOW TO:获取执行代码所处环境信息(小结)现在做一个方法运行耗时测试类 Imports System.ComponentModelNamespace uReflection Public Class CurrentMethodInfo Private gMethodInformation As currentMethodInformation ... 阅读全文

posted @ 2006-08-17 00:17 水如烟(LzmTW) 阅读(346) 评论(0) 推荐(0) 编辑

摘要:一般是静态方法 一、程序域 System.AppDomain.CurrentDomain 二、程序集 程序入口System.Reflection.Assembly.GetEntryAssembly() 当前方法所在System.Reflection.Assembly.GetExecutingAssembly() 当前方法的调用者方法所在System.Reflection.Assembly.GetC... 阅读全文

posted @ 2006-08-16 21:46 水如烟(LzmTW) 阅读(233) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟 这个类要利用上面的鼠标键盘钩子类StatusKeySateWatcher.EventArgs.vb 事件参数定义 Namespace uWindows Partial Class StatusKeySateWatcher Public Class EventArgs Inherits System.EventArgs ... 阅读全文

posted @ 2006-08-05 19:24 水如烟(LzmTW) 阅读(381) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟 因为不懂术语,以下只列代码,不作说明:SafeNativeMethods.vb,要用到的系统函数 Imports System.Runtime.InteropServicesImports System.TextNamespace uWindows Friend Class SafeNativeMethods Sub New() End Su... 阅读全文

posted @ 2006-08-05 19:14 水如烟(LzmTW) 阅读(503) 评论(1) 推荐(0) 编辑

摘要:Author:水如烟 使用代码示例: Public Class Form1 Private Sub box1TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Send(Me.TextBox1.Text) End Sub Private Sub Send(ByVal s As... 阅读全文

posted @ 2006-08-02 15:04 水如烟(LzmTW) 阅读(571) 评论(1) 推荐(0) 编辑

摘要:Author:水如烟 Option Strict OffNamespace uIO Public Class File '前期绑定的话需引用COM:Microsoft Shell Controls And Automation Public Shared Function GetDetails(ByVal file As String) As Dictionary... 阅读全文

posted @ 2006-06-10 22:18 水如烟(LzmTW) 阅读(448) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟 因为安全审核,一般用Access打开一个文件时显示安全警告,作了选择后才进行下去,用代码打开也一样。因此,为取消这个选择,不让它显示出来,需要将安全级别设置为最低,但是,程序退出之前,必须记住设回默认值。 在Office2003,可以直接读取和设置安全级别。 Namespace uOffice Public Enum MsoAutomationSecurityEnum ... 阅读全文

posted @ 2006-06-02 10:38 水如烟(LzmTW) 阅读(771) 评论(1) 推荐(0) 编辑

摘要:Author:水如烟 在前面的基本框架中给出了代码下载。到现在,其中一些文件需要修改,主要的是考虑了远程对象的使用,就是CreateObject(Application,Server),加了Server。只是,现在给出的代码还是只是支持本地的。修改后的有关文件如下:ApplicationBase.vb Option Strict OffNamespace uOffice Public Mus... 阅读全文

posted @ 2006-06-01 17:18 水如烟(LzmTW) 阅读(842) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟 异类HOW TO:适时弹出指示框(一)(AOP参考) 异类HOW TO:适时弹出指示框(二) (基础类)异类HOW TO:适时弹出指示框(三) (基础类的操作)异类HOW TO:适时弹出指示框(四) (指示框的实现)异类HOW TO:适时弹出指示框(五) (指示框)异类HOW TO:适时弹出指示框(六) (日志的实现)异类HOW TO:适时弹出指示框(七) (测试)HowTO... 阅读全文

posted @ 2006-05-30 12:54 水如烟(LzmTW) 阅读(365) 评论(0) 推荐(0) 编辑

摘要:测试类: Imports LzmTW.ApplicationBaseImports LzmTW.uRemoting.MethodWatcher _ _ _ _Public Class MethodWatcherTestClass Inherits ContextBoundObject Public Function Add(ByVal x As Integer, ByVal y A... 阅读全文

posted @ 2006-05-30 12:17 水如烟(LzmTW) 阅读(331) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟日志的实现:MethodLogAttribute.vb Namespace uRemoting.MethodWatcher _ Public Class MethodLogAttribute Inherits MethodWatcherBaseAttribute Protected Overrides Function GetMetho... 阅读全文

posted @ 2006-05-30 12:08 水如烟(LzmTW) 阅读(322) 评论(0) 推荐(0) 编辑

摘要:Author:水如烟指示框:MessageForm.Designer.vb Namespace ApplicationBase _ Partial Class MessageForm Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component li... 阅读全文

posted @ 2006-05-30 12:01 水如烟(LzmTW) 阅读(825) 评论(0) 推荐(0) 编辑