'窗体上加入控件command1,然后复制下面代码,运行,按command1即可。
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal _
dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, ByVal dwMilliseconds As Long) _
As Long
Private Const INFINITE = -1&
Private Const SYNCHRONIZE = &H100000
Private Sub Command1_Click()
Dim i As Long, S As String, FileName As String, Ip As String, Mac As String
Dim TaskID As Long ' Task-ID des DOS-Fensters
Dim ProcID As Long ' Prozess-ID des DOS-Fensters
FileName = "c:\1.txt"
If Dir(FileName) <> "" Th ......
VB6里面的安装内容中有JET (IISAM)部件,安装时加以选择,你可以修复安装你的VB6。具体做法如下:
1、重新启动VB安装程序,选取工作站工具和组件=》添加、删除程序=》数据访问=》更改选项=》选中Jet IIsam
2、重装VB,安装时选自定义,全部选中。 ......
原创: CSDN 许仙 ; qq:19030300 主页:http://hot1kang1.126.com
'转载请保持信息的完整性 谢谢
'参考网络代码完成, 获取机器的MAC 网卡地址
VB获取机器的硬盘物理地址和硬盘型号 http://blog.csdn.net/hot1kang1/archive/2006/03/27/639735.aspx
'----------------
'GetMyMAC 获得本机器网卡 MAC地址 若无IP 返回空字符
' Print GetMyMAC
'GetRemoteMACAddress IP,strval 获取对应机器的网卡 MAC地址
'dim i
'GetRemoteMACAddress "192.168.0.1",i
'Print i
'
'GetIPAddress 返回给定机器名的Ip地址,机器名为空时返回本机Ip地址
' GetIPAddress 机器名
'----------------
Option Explicit
Private Declare Function gethostname _
Lib "wsock32.dll" (ByVal szHost As String, _
ByVal dwHostLen As Long) As Lo ......
作者:taowen, billrice
http://www.cnblogs.com/taowen/articles/11239.html
Lesson 1 准备好学习Python的环境
下载的地址是:
www.python.org
为了大家的方便,我在校内作了copy:
http://10.1.204.2/tool/compiler&IDE/Python-2.3.2-1.exe
linux版本的我就不说了,因为如果你能够使用linux并安装好说明你可以一切自己搞定的。
运行环境可以是linux或者是windows:
1、linux
redhat的linux安装上去之后一定会有python的(必须的组件),在命令行中输入python回车。这样就可以进入一个
>>>的提示符
2、windows
安装好了python之后,在开始菜单里面找到Python2.3->IDLE,运行也会进入一个有
>>>提示符的窗口
开始尝试Python
1、输入:
welcome = "Hello!"
回车
然后又回到了>>>
2、输入:
print welcome
回车
然后就可以看到你自己输入的问候了。
Lesson 2 搞定环境之后的前行
Python有一个交互式的命令行,大家已经看到了吧。所以可以比较方便的学习和尝试,不用“新建-存档-编译-调试”,非常适合快速的尝试。
一开始从变量开始(其实说变量,更准确的是对象,Python中什么都可以理解为对象)。
......
最近要用到串口通讯,简单易用的Python又帮上忙了,多亏了庞大的第三方资源~~~ :)
pySerial
Overview
This module encapsulates the access for the serial port. It provides
backends for Python running on Windows, Linux, BSD (possibly any POSIX
compliant system), Jython and IronPython (.NET and Mono). The module
named "serial" automatically selects the appropriate backend.
It is released under a free software license, see LICENSE.txt
for more details.
(C) 2001-2008 Chris Liechti cliechti@gmx.net
The project page on SourceForge
and here is the SVN repository
and the Download Page
.
The homepage is on http://pyserial.sf.net/
Features
same class based interface on all supported platforms
access to the port settings through Python 2.2+ properties
port numbering starts at zero, no need to know the port name in the user program
port string (device name) can be specified if access through numbering is inappropriate
support for different bytesizes, stopbits, pari ......
如有一路径"e:/software/测试.txt"
需要通过pyhon读/写 "测试.txt"文件,可以采用下面的方法:
ipath = "e:/software/测试.txt"
uipath = unicode(ipath , "utf8")
然后用"uipath"经过编码后的路径去open()即可。
下面是我在项目中用python读写excel的一点体会(解决了读中文文件名问题,其实中文目录路径也一样):
def transExcel( inPath ) :
excelApp = Dispatch("Excel.Application")
inWorkbooks = excelApp.Workbooks.Open( unicode( inPath, "utf8" ) )
#测试下inWorkbooks这个东东有地址么?
print "transExcel...",inWorkbooks
transExcel("e:/software/测试.xls") ......