不死猫 发表于 2014-6-13 13:04:16

OpenDCL、打印设定、文件上传、oracle数据库、sql数据库、程序自动更新、MD5加密等

本帖最后由 不死猫 于 2014-6-13 18:01 编辑

因为服务器配置各不相同,因此代码在未配置好服务器的情况下不能运行完整。
代码供大家参考,每段函数都可以自己修改使用。
程序主要功能是实现用户登录后提取图纸信息加条码打印上传并写信息进数据库。
比较有特点的功能包括:程序自动更新,oracle数据库的读取、Sql数据库返回影响的行、文件自动上传和验证、MD5加密的借用方法等。
对话框放二楼了。

sygplot.lsp(vl-bb-set 'projectname "882+2117114+XM-211-33+西丽工程")
(vl-bb-set 'sgyname "cat");使用黑板主要是为了多图纸切换时保持登录状态

;不死猫老师空间http://nonsmall.mjtd.com
;Lisp教程http://vlisp.taobao.com/
(vl-load-com)

(setq *Path "C:\\sgyplot\\打印\\")
(setq *IP "192.168.0.11")
(setq *SQLIP "192.168.0.1")
(setq objShell (vlax-create-object "wscript.shell"))
(repeat 3
(vlax-invoke objShell "run" (strcat "cmd.exe /c net use \\\\" *IP "\\ipc$ /user:administrator password") 0)
)
(setq fso (vlax-create-object "Scripting.FileSystemObject"))
(setq file "c:\\sgyplot\\sgyplot.fas")
;程序自动更新 程序已经加入启动组的情况下
(if (findfile file)
(progn
    (setq file (Vlax-Invoke-Method fso 'GetFile file))
    (setq myfilesize (Vlax-Get file 'Size ))
    (setq myfileDateLastModified (Vlax-Get file 'DateLastModified ))
    (setq myfileAttributes (Vlax-Get file 'Attributes ))
    (setq newfile (Vlax-Invoke-Method fso 'GetFile (strcat "\\\\" *IP "\\cad打印系统\\程序\\sgyplot\\sgyplot.fas")))
    (if (not (and newfile
      (equal (Vlax-Get newfile 'Size ) myfilesize)
      (equal (Vlax-Get newfile 'DateLastModified ) myfileDateLastModified)
      (equal (Vlax-Get newfile 'Attributes ) myfileAttributes)
      ))
      (progn
      (alert "发现不死猫打印程序新版本,点击确认更新!")
      (vlax-invoke-method newfile 'copy "c:\\sgyplot\\" :vlax-true)
      (alert "更新完成,请重新打开CAD完成升级.")
      )
    )
)
(progn
    (vl-mkdir "c:\\sgyplot\\")
    (setq newfile (Vlax-Invoke-Method fso 'GetFile (strcat "\\\\" *IP "\\cad打印系统\\程序\\sgyplot\\sgyplot.fas")))
    (vlax-invoke-method newfile 'copy "c:\\sgyplot\\" :vlax-true)
    (alert "更新完成,请重新打开CAD完成升级.")
)
)
(defun c:sgyplot()
(vl-load-com)
;(setq *IP "192.168..14")
(setq *Folder "\\新建文件夹\\打印系统上传\\")
(setq *folder_tukuang "\\新建文件夹\\标准图框\\")
;(load (strcat *path "1 用户登录.lsp"))
;(load (strcat *path "2 图纸设定及打印.lsp"))
;(load (strcat *path "3 图纸上传.lsp"))
;(load (strcat *path "4 图框处理.lsp"))
;(load (strcat *path "5 生成条形码.lsp"))
(setq *sgy-recordFile "c:\\sgyPlot\\sgyplot.txt")
(command "opendcl")
;(setq Dcl '())
;(dcl_project_import Dcl nil nil)
(dcl_project_load (strcat *path "sgyPlot.odcl") T)
(dcl_form_show sgyPlot_sgyPlot)
(dcl_Control_SetEnabled sgyPlot_sgyPlot_CheckBox1 nil)
(dcl_Control_SetEnabled sgyPlot_sgyPlot_CheckBox2 nil)
(dcl_Control_SetEnabled sgyPlot_sgyPlot_CheckBox3 nil)
(dcl_Control_SetEnabled sgyPlot_sgyPlot_TextButton1 nil)
(dcl_Control_SetBackColor sgyPlot_sgyPlot_Label8 2)
(if (vl-bb-ref 'sgyname)
    (progn
      (dcl_TabStrip_SetCurSel sgyPlot_sgyPlot_TabStrip1 1)
      (dcl_Control_SetEnabled sgyPlot_sgyPlot_TextButton1 T)
      (dcl_Control_SetCaption sgyPlot_sgyPlot_Label8 (vl-bb-ref 'sgyname))
      (dcl_Control_SetBackColor sgyPlot_sgyPlot_Label8 7)
    )
    (progn
      (dcl_TabStrip_SetCurSel sgyPlot_sgyPlot_TabStrip1 )
    )
)
;设置下拉菜单宽度
(dcl_ComboBox_SetDroppedWidth sgyPlot_sgyPlot_ComboBox4 6)
(dcl_ComboBox_AddList sgyPlot_sgyPlot_ComboBox5 '("建筑" "电气" "金结" "景观" "结构" ))
(dcl_ComboBox_AddList sgyPlot_sgyPlot_ComboBox6 '("建议书" "方案" "可研" "初设" "施工图" "竣工图"))
;初始化
(if (not (findfile *sgy-recordFile))
    (progn
      (vl-mkdir "c:\\sgyLisp")
      (setq f (open *sgy-recordFile "a"))
      (write-line "," f)
      (write-line "," f)
      (write-line "1" f)
      (write-line "1" f)
      (write-line "1" f)
      (write-line "1" f)
      (write-line "1" f)
      (write-line "1" f)
      (write-line "" f);项目名称
      (write-line "1" f);项目阶段
      (write-line "1" f);图纸专业
      (close f)
      (read-record)
    )
    (progn
      (read-record)
    )
)
;初始化完成
)
(defun non_string_to_list(str del / lst)
(while (/= str (setq str (vl-string-subst "@" del str))))
(while (setq del (vl-string-position (ascii "@") str))
      (setq del (substr str 1 del))
      (setq str (vl-string-left-trim (strcat del) str))
      (setq lst (append lst (list del)))
      (setq str (substr str 2 (strlen str)))
)
(append lst (list str))
)
(defun vlax-2d-point (pt)
(vlax-make-variant(vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '( . 1)) (list (car pt)(cadr pt))))
)
;用户登录使用MD5加密验证
(defun c:sgyPlot_sgyPlot_GraphicButton3_OnClicked (/)
(setq shell (vlax-create-object "Wscript.Shell"))
(vlax-invoke shell "Run" (strcat "cmd /c wscript.exe C:\\sgyPlot\\MD5.vbs " (dcl_Control_GetText sgyPlot_sgyPlot_TextBox4)) 0)
(setq getlogin (login (dcl_Control_GetText sgyPlot_sgyPlot_TextBox3)))
(setq password (car getlogin))
(setq name (cadr getlogin))
(setq objShell (vlax-create-object "wscript.shell"))
(vlax-invoke objShell "run" (strcat "cmd.exe /c net use \\\\" *IP "\\ipc$ /user:administrator password") 0)
;(command "delay" "1000")
;(vlax-invoke shell "Popup" "123" 1 "aa" )
(setq file (open "C:\\sgyPlot\\MD5.txt" "r"))
(setq md5 (read-line file))
(close file)
(if password
    (if (equal password md5)
      (progn
      (dcl_Control_SetEnabled sgyPlot_sgyPlot_TextButton1 T)
      (dcl_Control_SetCaption sgyPlot_sgyPlot_Label8 name)
      (dcl_Control_SetBackColor sgyPlot_sgyPlot_Label8 7)
      (vl-bb-set 'sgyname name)
      (dcl_TabStrip_SetCurSel sgyPlot_sgyPlot_TabStrip1 1)
      (alert "登录成功!")
      )
      (alert "密码错误!")
    )
    (alert "用户名不存在")
)
)
;oracle数据库读取
(defun login(name / con record fields field return)
(Setq con (Vlax-Get-Or-Create-Object "adodb.connection" ))
(Vlax-Invoke con 'Open "Provider=MSDAORA.1;Data Source=192.168.0.8/test;User ID=project;password=project;Persist Security Info=False")
(Setq Record (Vlax-Get-Or-Create-Object "adodb.Recordset" ))
;(Vlax-Invoke Record 'Open (strcat "select password from test.view_users_2 where username = 'huq'") con 1 3)
(Vlax-Invoke Record 'Open (strcat "select name,password from test.view_users_2 where username = '" name "'") con 1 3)
(if (/= (Vlax-Get Record 'EOF ) -1)
    (progn
      (Vlax-Invoke-Method Record 'MoveFirst )
      (setq fields (vlax-get-property record'Fields))
      (setq field (Vlax-Invoke fields 'Item "password" ))
      (setq password (Vlax-Get field 'Value ))
      (setq name (Vlax-Invoke fields 'Item "name" ))
      (setq name (Vlax-Get name 'Value ))
    )
)
(Vlax-Invoke-Method Record 'Close )
(Vlax-Invoke-Method con 'Close )
(vlax-release-object Record)
(vlax-release-object con)
(list password name)
)
;defun 开始打印
;条码程序请参见Gu版的帖子
(defun c:sgyPlot_sgyPlot_TextButton1_OnClicked (/)
(if (or
      (= (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) "")
      (= (dcl_Control_GetText sgyPlot_sgyPlot_TextBox2) "")
      (= (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox1) "")
      (= (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox2) "")
      (= (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox3) "")
    )
    (alert "信息填写不完整,无法打印")
    (progn
;      (func-uploadpaper)
      (if (func-uploadpaper)
      (progn
          (sgy-write-record)
    ;      (command "qsave")
          ;获取图纸两个点minPt maxPt
          (if (< (car (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ",")))(car (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox2) ","))))
            (setq minPt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ",")) maxPt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox2) ",")))
    ;      否则交换两点
            (setq minPt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox2) ",")) maxPt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ",")))
          )
          (setq *id (sgySQLinsert))
          (setq id (substr (setq id (strcat "000" *id)) (- (strlen id) 1)))
          (setvar "cmdecho" 0)
          (setq tiaomaLen (- (car maxpt)(car minpt)))
          (setq scale (/ tiaomaLen 370.29))
          (setq code (substr (vl-string-subst "" "." (rtos (getvar "cdate") 2 7) )3 10))
          (setq code (strcat code id))
          (setq ss (sgy-tiaoma minPt scale code))
          (sgySQLinsertTiaoMa *id *Tiaomacode)
          (print *Tiaomacode)
          (command "scale" ss "" "non" minPt scale)
          (command "rotate" ss "" "non" minpt "90")
          (command "move" ss "" "non" minpt "non" (polar (polar minpt 0 (* tiaomaLen 0.025)) 1.5708 (* tiaomaLen 0.02)))
          ;放置条码
          (print "放置条码")
          (vl-catch-all-apply'c:sgyPlot_sgyPlot_TextButton2_OnClicked)
          (Vlax-Invoke-Method (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Plot) 'PlotToDevice )
          (command "erase" ss "")
;          开始打印
          (setvar "cmdecho" 1)
          (princ "\n已发送到打印机开始打印!")
      )
      )
    )
)
(princ)
)


;defun 搜索项目名称
(defun c:sgyPlot_sgyPlot_GraphicButton5_OnClicked (/)
(setq name (dcl_Control_GetText sgyPlot_sgyPlot_TextBox5))
(if (= name "")
    (progn
      (dcl_Control_SetToolTipMainText sgyPlot_sgyPlot_TextBox5 "请输入项目名称然后点击搜索!")
      (dcl_Control_ShowToolTip sgyPlot_sgyPlot_TextBox5)
    )
    (progn
      (repeat 10 (setq name (vl-string-subst "%" " " name)))
      (repeat 10 (setq name (vl-string-subst "%" " " name)))
      (setq *projectList (getProjectName name))(if *projectList
      (progn
          (setq projectNameList (mapcar '(lambda (x) (cadddr (non_string_to_list x "+"))) *projectList))
          (dcl_ComboBox_Clear sgyPlot_sgyPlot_ComboBox4)
          (dcl_ComboBox_AddList sgyPlot_sgyPlot_ComboBox4 projectNameList)
          (dcl_Control_SetToolTipMainText sgyPlot_sgyPlot_ComboBox4 (strcat "\n找到" (itoa (length projectNameList)) "个项目\n"))
          (dcl_ComboBox_SetCurSel sgyPlot_sgyPlot_ComboBox4 0)
          (dcl_Control_ShowToolTip sgyPlot_sgyPlot_ComboBox4)
      )
      (progn
          (dcl_Control_SetToolTipMainText sgyPlot_sgyPlot_ComboBox4 (strcat "\n找到" (itoa (length re)) "个项目\n"))
          (dcl_ComboBox_Clear sgyPlot_sgyPlot_ComboBox4)
          (dcl_Control_ShowToolTip sgyPlot_sgyPlot_ComboBox4)
      )
      )
    )
)
)
;defun 打印预览
(defun c:sgyPlot_sgyPlot_TextButton3_OnClicked (/)
(Vlax-Invoke-Method (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Plot) 'DisplayPlotPreview acFullPreview )
)
;defun 两点选择
(defun c:sgyPlot_sgyPlot_GraphicButton1_OnClicked (/)
;(if (/= (getvar "CMDACTIVE") 0)
;    (command)
;)
(setq *layout (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'ActiveLayout))
(setq pt1 (getpoint "\n请选择打印第1点"))
(if pt1 (setq pt2 (getcorner pt1 "\n请选择打印第2点")))
(if (and pt1 pt2)
    (progn
      (setq pt1 (list (min (car pt1)(car pt2)) (min (cadr pt1)(cadr pt2))))
      (setq pt2 (list (max (car pt1)(car pt2)) (max (cadr pt1)(cadr pt2))))
      (dcl_Control_SetText sgyPlot_sgyPlot_TextBox1 (strcat (rtos (car pt1) 2 4) "," (rtos (cadr pt1) 2 4)))
      (dcl_Control_SetText sgyPlot_sgyPlot_TextBox2 (strcat (rtos (car pt2) 2 4) "," (rtos (cadr pt2) 2 4)))
      (setq *plotPtx pt1)
      (setq *plotPty pt2)
;      打印两点
      (Vlax-Invoke-method *layout 'SetWindowToPlot (vlax-2d-point pt1) (vlax-2d-point pt2))
      (Vlax-Invoke-Method (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Regen acActiveViewport )
    )
)
)
;defun 选择矩形
(defun c:sgyPlot_sgyPlot_GraphicButton2_OnClicked (/)
(setq *layout (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'ActiveLayout))
(setq rec (entsel "\n请选择打印的矩形框"))
(if rec
    (progn
      (Vlax-Invoke-Method (Vlax-Ename->Vla-Object (car rec)) 'GetBoundingBox 'ptx 'pty)
      (setq ptx (vlax-safearray->list ptx))
      (setq pty (vlax-safearray->list pty))
      (setq *plotPtx ptx)
      (setq *plotPty pty)
      (dcl_Control_SetText sgyPlot_sgyPlot_TextBox1 (strcat (rtos (car ptx) 2 4) "," (rtos (cadr ptx) 2 4)))
      (dcl_Control_SetText sgyPlot_sgyPlot_TextBox2 (strcat (rtos (car pty) 2 4) "," (rtos (cadr pty) 2 4)))
;      打印两点
      (Vlax-Invoke-method *layout 'SetWindowToPlot (vlax-2d-point ptx) (vlax-2d-point pty))
      (Vlax-Invoke-Method (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Regen acActiveViewport )
    )
)
)
;defun 应用到布局
(defun c:sgyPlot_sgyPlot_TextButton2_OnClicked (/)
(setq *layout (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'ActiveLayout))
;打印的两个点
(if (> (length *plotPtx) 2)
    (setq *plotPtx (reverse (cdr (reverse *plotPtx))))
)
(if (> (length *plotPty) 2)
    (setq *plotPty (reverse (cdr (reverse *plotPty))))
)
(Vlax-Invoke-method *layout 'SetWindowToPlot (vlax-2d-point *plotPtx) (vlax-2d-point *plotPty))
;(Vlax-Invoke-Method (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'ActiveLayout) 'GetCustomScale 1 1 )
(Vlax-Put-Property (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'ActiveLayout) 'PlotType acWindow )
;打印机
(Vlax-Put-Property *layout 'ConfigName (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox1))
;图纸大小
(Vlax-Put-Property *layout 'CanonicalMediaName (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox2))
;按样式打印
(Vlax-Put-Property *layout 'PlotWithPlotStyles -1 )
;打印样式
(Vlax-Put-Property *layout 'StyleSheet (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox3))
;偏移
;(Vlax-Put-Property (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'ActiveLayout) 'PlotOrigin (Vlax-2d-Point '(0 0)))
;居中打印
(Vlax-Put-Property *layout 'CenterPlot (- 0 (dcl_Control_GetValue sgyPlot_sgyPlot_CheckBox1)))
;厘米单位
(Vlax-Put-Property *layout 'PaperUnits acMillimeters )
;是否纵向打印
(Vlax-Put *layout 'PlotRotation (dcl_Control_GetValue sgyPlot_sgyPlot_CheckBox3))
;铺满图纸
(Vlax-Put-Property *layout 'UseStandardScale acScaleToFit )
(Vlax-Put-Property *layout 'UseStandardScale (- 0 (dcl_Control_GetValue sgyPlot_sgyPlot_CheckBox2)) )
(Vlax-Put-Property *layout 'StandardScale 0 )
(Vlax-Invoke-Method (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Regen acActiveViewport )
(Vlax-Invoke-method *layout 'SetWindowToPlot (vlax-2d-point (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ","))) (vlax-2d-point (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox2) ","))))
(Vlax-Invoke-Method (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Regen acActiveViewport )
)
;defun 居中打印
(defun c:sgyPlot_sgyPlot_CheckBox1_OnClicked (Value /)
(vl-catch-all-apply'c:sgyPlot_sgyPlot_TextButton2_OnClicked)
)
;defun 铺满图纸
(defun c:sgyPlot_sgyPlot_CheckBox2_OnClicked (Value /)
(vl-catch-all-apply'c:sgyPlot_sgyPlot_TextButton2_OnClicked)
)
;defun 横向打印
(defun c:sgyPlot_sgyPlot_CheckBox3_OnClicked (Value /)
(vl-catch-all-apply'c:sgyPlot_sgyPlot_TextButton2_OnClicked)
)
;defun 记录打印配置
(defun sgy-write-record()
(setq f (open *sgy-recordFile "w"))
(write-line (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) f)
(write-line (dcl_Control_GetText sgyPlot_sgyPlot_TextBox2) f)
(write-line (itoa (dcl_ComboBox_GetCurSel sgyPlot_sgyPlot_ComboBox1)) f)
(write-line (itoa (dcl_ComboBox_GetCurSel sgyPlot_sgyPlot_ComboBox2)) f)
(write-line (itoa (dcl_ComboBox_GetCurSel sgyPlot_sgyPlot_ComboBox3)) f)
(write-line (itoa (dcl_Control_GetValue sgyPlot_sgyPlot_CheckBox1)) f)
(write-line (itoa (dcl_Control_GetValue sgyPlot_sgyPlot_CheckBox2)) f)
(write-line (itoa (dcl_Control_GetValue sgyPlot_sgyPlot_CheckBox3)) f)
(write-line (dcl_Control_GetText sgyPlot_sgyPlot_TextBox5) f)
(write-line (itoa (dcl_ComboBox_GetCurSel sgyPlot_sgyPlot_ComboBox6)) f)
(write-line (itoa (dcl_ComboBox_GetCurSel sgyPlot_sgyPlot_ComboBox5)) f)
(close f)
)
;defun 读取打印配置
(defun read-record()
(setq f (open *sgy-recordFile "r"))
(dcl_Control_SetText sgyPlot_sgyPlot_TextBox1 (read-line f ))
(dcl_Control_SetText sgyPlot_sgyPlot_TextBox2 (read-line f ))
(dcl_ComboBox_SetCurSel sgyPlot_sgyPlot_ComboBox1 (read (read-line f )))
(dcl_ComboBox_Clear sgyPlot_sgyPlot_ComboBox2)
(dcl_ComboBox_SetCurSel sgyPlot_sgyPlot_ComboBox2 (read (read-line f )))
(dcl_ComboBox_SetCurSel sgyPlot_sgyPlot_ComboBox3 (read (read-line f )))
(dcl_Control_SetValue sgyPlot_sgyPlot_CheckBox1 (read (read-line f )))
(dcl_Control_SetValue sgyPlot_sgyPlot_CheckBox2 (read (read-line f )))
(dcl_Control_SetValue sgyPlot_sgyPlot_CheckBox3 (read (read-line f )))
(dcl_Control_SetText sgyPlot_sgyPlot_TextBox5 (read-line f ))
(dcl_ComboBox_SetCurSel sgyPlot_sgyPlot_ComboBox6 (read (read-line f )))
(dcl_ComboBox_SetCurSel sgyPlot_sgyPlot_ComboBox5 (read (read-line f )))
(close f)
)
;defun 获取项目名称
(defun getProjectName(name / con    return)
(Setq con (Vlax-Get-Or-Create-Object "adodb.connection" ))
(Vlax-Invoke con 'Open "Provider=MSDAORA.1;Data Source=192.168.0.8/test;User ID=project;password=project;Persist Security Info=False")
(Setq Record (Vlax-Get-Or-Create-Object "adodb.Recordset" ))
(Vlax-Invoke Record 'Open (strcat "select * from test.view_project where proname like '%" name "%'") con 1 3)
(if (= (Vlax-Get Record 'EOF ) 0)
    (Vlax-Invoke-Method Record 'MoveFirst )
)
(while (= (Vlax-Get Record 'EOF ) 0)
    (progn
      (setq fields (vlax-get-property record'Fields))
      ;项目名称
      (setq proname (Vlax-Invoke fields 'Item "proname" ))
      (setq proname (Vlax-Get proname 'Value ))
      ;业务编号
      (setq probh (Vlax-Invoke fields 'Item "probh" ))
      (setq probh (Vlax-Get probh 'Value ))
      ;业务号
      (setq busino (Vlax-Invoke fields 'Item "busino" ))
      (setq busino (Vlax-Get busino 'Value ))
      ;ID
      (setq Id (Vlax-Invoke fields 'Item "id" ))
      (setq Id (vlax-variant-value (vlax-variant-change-type (Vlax-Get-property Id 'Value ) vlax-vbString)))
      (if proname (setq return (cons (strcat Id "+" busino "+" probh "+" proname) return)))
      (Vlax-Invoke-Method Record 'MoveNext)
    )
)
(Vlax-Invoke-Method Record 'Close )
(Vlax-Invoke-Method con 'Close )
(vlax-release-object Record)
(vlax-release-object con)
return
)
;选择项目名称
(defun c:sgyPlot_sgyPlot_ComboBox4_OnSelChanged (ItemIndexOrCount Value /)
(vl-bb-set 'projectname (nth ItemIndexOrCount *projectList))
)
(defun func-uploadpaper()
(if
    (or ;临时代码
      (not (vl-bb-ref 'projectname))
      (= (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox5) "")
      (= (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox6) "")
    )
    (alert "项目、专业、阶段请填写完整!")
    (progn
      (setq tmp (vl-bb-ref 'projectname))
      (setq tmp (non_string_to_list tmp "+"))
      (setq *UploadFolder (strcat (cadr tmp) "+" (caddr tmp)))
      (setq *MyPro (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox5))
      (setq *Myphase (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox6))
      (if (or
      (and (= (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Saved ) 0) (= 1 (dcl_MessageBox "是否保存并上传?" "图纸尚未保存" 3 2)) (not (command "qsave" "")))
      (= (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Saved ) -1))
      (progn
;          (alert "请保存图纸再打印!")
;          (setq return nil)
          (command "qsave")
      )
      )
      ;打开共享
      (setq objShell (vlax-create-object "wscript.shell"))
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 10)
      (print "预备上传")
      ;net use \\192.168.0.11\ipc$$$$$$$$ /user:administrator
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 20)
      (setq fso (vlax-create-object "Scripting.FileSystemObject"))
      (print "工程目录处理")
      ;建立项目文件夹
      (setq folder (strcat "\\\\" *IP *Folder *UploadFolder "\\"))
      (vl-mkdir folder)
      ;项目阶段
      (setq folder (strcat folder *Myphase "\\"))
      (vl-mkdir folder)
      ;项目专业
      (setq folder (strcat folder *MyPro "\\"))
      (vl-mkdir folder)
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 30)
      ;(setq isFolder (vlax-invoke fso 'GetFolder folder))
      ;获取本地文件
      (setq dwgpath (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Path ))
      (setq dwgname (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Name ))
      (print "文件验证")
      (setq file (Vlax-Invoke-Method fso 'GetFile (strcat dwgpath "\\" dwgname)))
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 40)
      ;本地文件属性
      (setq myfilesize (Vlax-Get file 'Size ))
      (setq myfileDateLastAccessed (Vlax-Get file 'DateLastAccessed ))
      (setq myfileDateLastModified (Vlax-Get file 'DateLastModified ))
      (setq myfileAttributes (Vlax-Get file 'Attributes ))
      ;文件上传
      (print "文件上传")
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 50)
      (vlax-invoke-method file 'copy folder :vlax-true)
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 60)
      ;上传后验证文件是否相同
      (print "验证上传文件")
      (setq newfile (Vlax-Invoke-Method fso 'GetFile (strcat folder "\\" dwgname)))
      (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 80)
      (if (and newfile
          (equal (Vlax-Get newfile 'Size ) myfilesize)
;          (equal (Vlax-Get newfile 'DateLastAccessed ) myfileDateLastAccessed 0.1)
          (equal (Vlax-Get newfile 'DateLastModified ) myfileDateLastModified)
          (equal (Vlax-Get newfile 'Attributes ) myfileAttributes)
      )
      (progn
          (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 100)
          (print "图纸上传成功!")
          (setq return T)
          (dcl_Control_SetValue sgyPlot_sgyPlot_ProgressBar1 1)
      )
      (progn
          (alert "上传失败!")
          (setq return nil)
      )
      )
    )
)
return
)

;上传测试
;(defun c:sgyPlot_sgyPlot_TextButton4_OnClicked()
;(sgySQLinsert)
;)
;这里能够返回插入数据库时返回影响的ID行号!
(defun sgySQLinsert (/date datelst x datestr y tmpis归档 is删除 sqlvaluesvalues con sql record fields field value insertline)
(print "数据库写入")
(setq String打印人 (vl-bb-ref 'sgyname))
(setq String打印时间 (setq date (rtos(getvar "cdate")2 8)
      datelst(mapcar '(lambda(x)(substr date (car x) (cadr x))) '((1 4) (5 2) (7 2) (10 2)(12 2)(14 2)))
      datestr(apply 'strcat (mapcar '(lambda(x y)(strcat x y)) datelst '("年" "月" "日" "时" "分" "秒" "毫秒")))))
(setq tmp (vl-bb-ref 'projectname))
(setq tmp (non_string_to_list tmp "+"))
(setq String合同ID (car tmp))
(setq String业务号 (cadr tmp))
(setq String项目编号 (caddr tmp))
(setq String项目名称 (cadddr tmp))
(setq String专业 (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox5))
(setq String项目阶段 (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox6))
(setq Dwg图纸名 (strcat (vl-filename-base (Vlax-Get (Vlax-Get (Vlax-Get-Acad-Object) 'ActiveDocument) 'Name )) ".dwg"))
(setq Sring图纸大小 (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox2))
(setq String打印机 (dcl_ComboBox_GetEBText sgyPlot_sgyPlot_ComboBox1))
(setq String条码 "" is归档 "0" is删除 "0")
(setq sqlvalues (list String打印人 String打印时间 String条码 String项目名称 String合同ID String项目阶段 String业务号 String项目编号String专业 Sring图纸大小 String打印机 Dwg图纸名 Dwg版本号 Dwg业务号 Dwg图号 Dwg图名 Dwg制图 Dwg比例 Dwg日期 is归档 is删除))
(setq values (apply 'strcat (mapcar '(lambda (x) (strcat "," (if x (strcat "'" x "'") "''") )) sqlvalues)))
(setq values (substr values 2))
(Setq con (Vlax-Get-Or-Create-Object "adodb.connection" ))
(Vlax-Invoke con 'Open (strcat "Driver={SQL Server};Server=" *SQLIP ";UID=sa;PWD=lzsjy;database=SGYPLOT;"))
(setq sql(strcat "INSERT INTO plot (plot_person,plot_time,dwg_tiaoma,project_name,project_hetong,project_jieduan,project_yewuhao,project_bianhao,project_zhuanye,project_size,project_plotter,dwg_name,dwg_ver,dwg_yewuhao,dwg_tuhao,dwg_tuming,dwg_zhitu,dwg_bili,dwg_date,isGuiDang,isDelete) VALUES (" values")" ))
(setq Record (vlax-invoke con 'execute sql))
(setq sql "SELECT @@IDENTITY AS NewID")
(Vlax-Invoke-Method Record 'NextRecordset )
(setq Record (vlax-invoke con 'execute sql))
(setq fields (vlax-get-property Record'Fields))
(setq field (Vlax-Invoke fields 'Item "NewID" ))
(setq value (Vlax-Get-property field 'Value ))
(setq insertLine(vlax-variant-value (vlax-variant-change-type value 8)))
(Vlax-Invoke-Method con 'Close)
(print "数据库写入完成")
insertLine
;(Setq Record (Vlax-Get-Or-Create-Object "adodb.Recordset" ))
;(Vlax-Invoke-Method Record 'NextRecordset )
;(setq fields (vlax-get-property record'Fields))
;(print (Vlax-Invoke fields 'Item "NewID" ))
;(while (/= (Vlax-Get Record 'EOF ) -1)
;    (foreach x (vlax-safearray->list (vlax-variant-value (Vlax-Invoke-Method Record 'GetRows 1 )))
;      (setq y x)
;      (print (vlax-variant-value (vlax-variant-change-type (car x) 8)))
;    )
;)
;(setq fields (vlax-get-property record'Fields))
;(setq field (Vlax-Invoke fields 'Item "fax" ))
;(print (Vlax-Get field 'Value ))
;(Vlax-Put-Property field 'Value "xxx" )
;(Vlax-Invoke-Method Record 'Update )
;(Vlax-Invoke-Method Record 'Close )
)
(defun sgySQLinsertTiaoMa (id code /)
(print "条码写入")
(Setq con (Vlax-Get-Or-Create-Object "adodb.connection" ))
(Vlax-Invoke con 'Open (strcat "Driver={SQL Server};Server=" *SQLIP ";UID=sa;PWD=lzsjy;database=SGYPLOT;"))
(setq sql(strcat "update plot set dwg_tiaoma = '" code "' where id = " "'" (vl-princ-to-string id) "'" ))
(vlax-invoke con 'execute sql)
(Vlax-Invoke-Method con 'Close)
(print "条码写入完成")
)
;(c:sgyPlot_sgyPlot_TextButton4_OnClicked)
;A1下载
(defun c:sgyPlot_sgyPlot_TextButton5_OnClicked (/)
(setq pt (getpoint "请选择插入点"))
(if pt
    (progn
      (setvar "cmdecho" 0)
      (command "layer" "n" "TT" "c" "4" "TT" "")
      (setvar "clayer" "TT")
      (command "insert" (strcat "\\\\" *IP *folder_tukuang "SGY-A1.dwg") pt 1 1 0)
      (setq pt (polar (polar pt (* pi 1.5) 0.1) pi 0.1))
      (setq pty (list (+ (car pt) 841.2)(+ (cadr pt) 594.2)))
      (command "zoom" pt pty)
      (command "explode" (entlast))
      (setq RDpt (list (+ (car pt) 420) (cadr pt)))
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -170) (+ (cadr RDpt) 10))
      (list (+ (car RDpt) -120) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg版本号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg版本号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -100) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -65) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg业务号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg业务号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -45) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -170) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -135) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg制图 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg制图 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -100) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -65) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg比例 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg比例 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -45) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg日期 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg日期 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -120) (+ (cadr RDpt) 24))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)59))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图名 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图名 "")
      )
      (vl-catch-all-apply 'sgy-tukuang-last2pt (list pt pty))
      (setvar "cmdecho" 1)
    )
)
(sgy-tukuang-info)
);A2下载
(defun c:sgyPlot_sgyPlot_TextButton6_OnClicked (/)
(setq pt (getpoint "请选择插入点"))
(if pt
    (progn
      (setvar "cmdecho" 0)
      (command "layer" "n" "TT" "c" "4" "TT" "")
      (setvar "clayer" "TT")
      (command "insert" (strcat "\\\\" *IP *folder_tukuang "SGY-A2.dwg") pt 1 1 0)
      (setq pt (polar (polar pt (* pi 1.5) 0.1) pi 0.1))
      (setq pty (polar (polar pt (* pi 0.5) 420.2) 0 594.2))
;      (setq pty (list (+ (car pt) 594)(+ (cadr pt) 420)))
      (setq las (entlast))
      (command "zoom" pt pty)
      (command "explode" (entlast))
      (setq RDpt (list (+ (car pt) 594) (cadr pt)))
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -115) (+ (cadr RDpt) 10))
      (list (+ (car RDpt) -80) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg版本号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg版本号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -65) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -45) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg业务号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg业务号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -30) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -115) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -90) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg制图 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg制图 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -65) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -45) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg比例 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg比例 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -30) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg日期 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg日期 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -80) (+ (cadr RDpt) 24))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)59))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图名 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图名 "")
      )
      (vl-catch-all-apply 'sgy-tukuang-last2pt (list pt pty))
      (setvar "cmdecho" 1)
    )
)

(sgy-tukuang-info)
);A3下载


(defun c:sgyPlot_sgyPlot_TextButton7_OnClicked (/ ptpty rdpt ss )
(setq pt (getpoint "请选择插入点"))
(if pt
    (progn
      (setvar "cmdecho" 0)
      (command "layer" "n" "TT" "c" "4" "TT" "")
      (setvar "clayer" "TT")
      (command "insert" (strcat "\\\\" *IP *folder_tukuang "SGY-A3.dwg") pt 1 1 0)
      (setq pt (polar (polar pt (* pi 1.5) 0.1) pi 0.1))
      (setq pty (list (+ (car pt) 420.2)(+ (cadr pt) 297.2)))
      (command "zoom" pt pty)
      (command "explode" (entlast))
      (setq RDpt (list (+ (car pt) 420) (cadr pt)))
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -83.75) (+ (cadr RDpt) 5))
      (list (+ (car RDpt) -57.5) (+ (cadr RDpt)10.25))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg版本号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg版本号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -46.25) (+ (cadr RDpt)5))
      (list (+ (car RDpt) -31.25) (+ (cadr RDpt)10.25))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg业务号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg业务号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -20) (+ (cadr RDpt)5))
      (list (+ (car RDpt) -5) (+ (cadr RDpt)10.25))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -83.75) (+ (cadr RDpt) 10.25))
      (list (+ (car RDpt) -65) (+ (cadr RDpt)15.5))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg制图 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg制图 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -46.25) (+ (cadr RDpt) 10.25))
      (list (+ (car RDpt) -31.25) (+ (cadr RDpt)15.5))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg比例 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg比例 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -20) (+ (cadr RDpt) 10.25))
      (list (+ (car RDpt) -5) (+ (cadr RDpt)15.5))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg日期 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg日期 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -57.5) (+ (cadr RDpt) 15.5))
      (list (+ (car RDpt) -5) (+ (cadr RDpt)41.75))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图名 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图名 "")
      )
      (vl-catch-all-apply 'sgy-tukuang-last2pt (list pt pty))
      (setvar "cmdecho" 1)
    )
)
(sgy-tukuang-info)
)
;打印范围根据图框设定
(defun sgy-tukuang-last2pt(ptx pty)
(setq *plotPtx ptx)
(setq *plotPty pty)
(dcl_Control_SetText sgyPlot_sgyPlot_TextBox1 (strcat (rtos (car ptx) 2 4) "," (rtos (cadr ptx) 2 4)))
(dcl_Control_SetText sgyPlot_sgyPlot_TextBox2 (strcat (rtos (car pty) 2 4) "," (rtos (cadr pty) 2 4)))
(c:sgyPlot_sgyPlot_TextButton2_OnClicked)
)
;A1
(defun c:sgyPlot_sgyPlot_TextButton4_OnClicked (/)
(setq pt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ",")))
(if pt
    (progn
      (setq RDpt (list (+ (car pt) 420) (cadr pt)))
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -170) (+ (cadr RDpt) 10))
      (list (+ (car RDpt) -120) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg版本号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg版本号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -100) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -65) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg业务号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg业务号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -45) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -170) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -135) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg制图 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg制图 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -100) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -65) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg比例 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg比例 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -45) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg日期 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg日期 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -120) (+ (cadr RDpt) 24))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)59))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图名 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图名 "")
      )
    )
)

(sgy-tukuang-info)
)
;A2
(defun c:sgyPlot_sgyPlot_TextButton8_OnClicked (/)
(setq pt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ",")))
(if pt
    (progn
      (setq RDpt (list (+ (car pt) 594) (cadr pt)))
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -115) (+ (cadr RDpt) 10))
      (list (+ (car RDpt) -80) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg版本号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg版本号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -65) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -45) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg业务号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg业务号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -30) (+ (cadr RDpt)10))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)17))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -115) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -90) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg制图 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg制图 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -65) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -45) (+ (cadr RDpt) 24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg比例 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg比例 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -30) (+ (cadr RDpt) 17))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)24))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg日期 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg日期 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -80) (+ (cadr RDpt) 24))
      (list (+ (car RDpt) -10) (+ (cadr RDpt)59))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图名 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图名 "")
      )
    )
)

(sgy-tukuang-info)
)
;A3
(defun c:sgyPlot_sgyPlot_TextButton9_OnClicked (/)
(setq pt (mapcar 'read (non_string_to_list (dcl_Control_GetText sgyPlot_sgyPlot_TextBox1) ",")))
(if pt
    (progn
      (setq RDpt (list (+ (car pt) 420) (cadr pt)))
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -83.75) (+ (cadr RDpt) 5))
      (list (+ (car RDpt) -57.5) (+ (cadr RDpt)10.25))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg版本号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg版本号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -46.25) (+ (cadr RDpt)5))
      (list (+ (car RDpt) -31.25) (+ (cadr RDpt)10.25))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg业务号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg业务号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -20) (+ (cadr RDpt)5))
      (list (+ (car RDpt) -5) (+ (cadr RDpt)10.25))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图号 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图号 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -83.75) (+ (cadr RDpt) 10.25))
      (list (+ (car RDpt) -65) (+ (cadr RDpt)15.5))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg制图 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg制图 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -46.25) (+ (cadr RDpt) 10.25))
      (list (+ (car RDpt) -31.25) (+ (cadr RDpt)15.5))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg比例 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg比例 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -20) (+ (cadr RDpt) 10.25))
      (list (+ (car RDpt) -5) (+ (cadr RDpt)15.5))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg日期 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg日期 "")
      )
      (if (setq ss (ssget "c"
      (list (+ (car RDpt) -57.5) (+ (cadr RDpt) 15.5))
      (list (+ (car RDpt) -5) (+ (cadr RDpt)41.75))
      '((0 . "*TEXT")(8 . "TT"))))
      (setq Dwg图名 (Vlax-Get (Vlax-Ename->Vla-Object (ssname ss 0)) 'TextString ))
      (setq Dwg图名 "")
      )
    )
)
(sgy-tukuang-info)
)
(defun sgy-tukuang-info()
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label14 (strcat "版本号:" Dwg版本号))
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label15 (strcat "业务号:" Dwg业务号))
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label16 (strcat "图号:" Dwg图号))
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label17 (strcat "制图:" Dwg制图))
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label18 (strcat "比例:" Dwg比例))
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label19 (strcat "日期:" Dwg日期))
(dcl_Control_SetCaption sgyPlot_sgyPlot_Label20 (strcat "图名:" Dwg图名))
)

(princ "\n打印程序加载成功!")
(princ "\n开发维护:不死猫")
(print "加载完成")
(print "不死猫老师空间http://nonsmall.mjtd.com")
(princ)Md5.vbs
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
m_lOnBits(0) = CLng(1)
m_lOnBits(1) = CLng(3)
m_lOnBits(2) = CLng(7)
m_lOnBits(3) = CLng(15)
m_lOnBits(4) = CLng(31)
m_lOnBits(5) = CLng(63)
m_lOnBits(6) = CLng(127)
m_lOnBits(7) = CLng(255)
m_lOnBits(8) = CLng(511)
m_lOnBits(9) = CLng(1023)
m_lOnBits(10) = CLng(2047)
m_lOnBits(11) = CLng(4095)
m_lOnBits(12) = CLng(8191)
m_lOnBits(13) = CLng(16383)
m_lOnBits(14) = CLng(32767)
m_lOnBits(15) = CLng(65535)
m_lOnBits(16) = CLng(131071)
m_lOnBits(17) = CLng(262143)
m_lOnBits(18) = CLng(524287)
m_lOnBits(19) = CLng(1048575)
m_lOnBits(20) = CLng(2097151)
m_lOnBits(21) = CLng(4194303)
m_lOnBits(22) = CLng(8388607)
m_lOnBits(23) = CLng(16777215)
m_lOnBits(24) = CLng(33554431)
m_lOnBits(25) = CLng(67108863)
m_lOnBits(26) = CLng(134217727)
m_lOnBits(27) = CLng(268435455)
m_lOnBits(28) = CLng(536870911)
m_lOnBits(29) = CLng(1073741823)
m_lOnBits(30) = CLng(2147483647)
m_l2Power(0) = CLng(1)
m_l2Power(1) = CLng(2)
m_l2Power(2) = CLng(4)
m_l2Power(3) = CLng(8)
m_l2Power(4) = CLng(16)
m_l2Power(5) = CLng(32)
m_l2Power(6) = CLng(64)
m_l2Power(7) = CLng(128)
m_l2Power(8) = CLng(256)
m_l2Power(9) = CLng(512)
m_l2Power(10) = CLng(1024)
m_l2Power(11) = CLng(2048)
m_l2Power(12) = CLng(4096)
m_l2Power(13) = CLng(8192)
m_l2Power(14) = CLng(16384)
m_l2Power(15) = CLng(32768)
m_l2Power(16) = CLng(65536)
m_l2Power(17) = CLng(131072)
m_l2Power(18) = CLng(262144)
m_l2Power(19) = CLng(524288)
m_l2Power(20) = CLng(1048576)
m_l2Power(21) = CLng(2097152)
m_l2Power(22) = CLng(4194304)
m_l2Power(23) = CLng(8388608)
m_l2Power(24) = CLng(16777216)
m_l2Power(25) = CLng(33554432)
m_l2Power(26) = CLng(67108864)
m_l2Power(27) = CLng(134217728)
m_l2Power(28) = CLng(268435456)
m_l2Power(29) = CLng(536870912)
m_l2Power(30) = CLng(1073741824)

SET ARR = WScript.Arguments
re = md5(arr(0))
Set fso =CreateObject("Scripting.FileSystemObject")
Set File = fso.CreateTextFile("c:\sgyPlot\md5.txt", True)
File.WriteLine(re)
File.Close
Private Function LShift(lValue, iShiftBits)
If iShiftBits = 0 Then
LShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And 1 Then
LShift = &H80000000
Else
LShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If

If (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
Else
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))
End If
End Function

Private Function RShift(lValue, iShiftBits)
If iShiftBits = 0 Then
RShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And &H80000000 Then
RShift = 1
Else
RShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If

RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)

If (lValue And &H80000000) Then
RShift = (RShift Or (&H40000000 \ m_l2Power(iShiftBits - 1)))
End If
End Function

Private Function RotateLeft(lValue, iShiftBits)
RotateLeft = LShift(lValue, iShiftBits) Or RShift(lValue, (32 - iShiftBits))
End Function

Private Function AddUnsigned(lX, lY)
Dim lX4
Dim lY4
Dim lX8
Dim lY8
Dim lResult

lX8 = lX And &H80000000
lY8 = lY And &H80000000
lX4 = lX And &H40000000
lY4 = lY And &H40000000

lResult = (lX And &H3FFFFFFF) + (lY And &H3FFFFFFF)

If lX4 And lY4 Then
lResult = lResult Xor &H80000000 Xor lX8 Xor lY8
ElseIf lX4 Or lY4 Then
If lResult And &H40000000 Then
lResult = lResult Xor &HC0000000 Xor lX8 Xor lY8
Else
lResult = lResult Xor &H40000000 Xor lX8 Xor lY8
End If
Else
lResult = lResult Xor lX8 Xor lY8
End If

AddUnsigned = lResult
End Function

Private Function F(x, y, z)
F = (x And y) Or ((Not x) And z)
End Function

Private Function G(x, y, z)
G = (x And z) Or (y And (Not z))
End Function

Private Function H(x, y, z)
H = (x Xor y Xor z)
End Function

Private Function I(x, y, z)
I = (y Xor (x Or (Not z)))
End Function

Private Sub FF(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub

Private Sub GG(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub

Private Sub HH(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub

Private Sub II(a, b, c, d, x, s, ac)
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac))
a = RotateLeft(a, s)
a = AddUnsigned(a, b)
End Sub

Private Function ConvertToWordArray(sMessage)
Dim lMessageLength
Dim lNumberOfWords
Dim lWordArray()
Dim lBytePosition
Dim lByteCount
Dim lWordCount

Const MODULUS_BITS = 512
Const CONGRUENT_BITS = 448

lMessageLength = Len(sMessage)

lNumberOfWords = (((lMessageLength + ((MODULUS_BITS - CONGRUENT_BITS) \ BITS_TO_A_BYTE)) \ (MODULUS_BITS \ BITS_TO_A_BYTE)) + 1) * (MODULUS_BITS \ BITS_TO_A_WORD)
ReDim lWordArray(lNumberOfWords - 1)

lBytePosition = 0
lByteCount = 0
Do Until lByteCount >= lMessageLength
lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE
lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(Asc(Mid(sMessage, lByteCount + 1, 1)), lBytePosition)
lByteCount = lByteCount + 1
Loop

lWordCount = lByteCount \ BYTES_TO_A_WORD
lBytePosition = (lByteCount Mod BYTES_TO_A_WORD) * BITS_TO_A_BYTE

lWordArray(lWordCount) = lWordArray(lWordCount) Or LShift(&H80, lBytePosition)

lWordArray(lNumberOfWords - 2) = LShift(lMessageLength, 3)
lWordArray(lNumberOfWords - 1) = RShift(lMessageLength, 29)

ConvertToWordArray = lWordArray
End Function

Private Function WordToHex(lValue)
Dim lByte
Dim lCount

For lCount = 0 To 3
lByte = RShift(lValue, lCount * BITS_TO_A_BYTE) And m_lOnBits(BITS_TO_A_BYTE - 1)
WordToHex = WordToHex & Right("0" & Hex(lByte), 2)
Next
End Function

Public Function MD5(sMessage)
Dim x
Dim k
Dim AA
Dim BB
Dim CC
Dim DD
Dim a
Dim b
Dim c
Dim d

Const S11 = 7
Const S12 = 12
Const S13 = 17
Const S14 = 22
Const S21 = 5
Const S22 = 9
Const S23 = 14
Const S24 = 20
Const S31 = 4
Const S32 = 11
Const S33 = 16
Const S34 = 23
Const S41 = 6
Const S42 = 10
Const S43 = 15
Const S44 = 21

x = ConvertToWordArray(sMessage)

a = &H67452301
b = &HEFCDAB89
c = &H98BADCFE
d = &H10325476

For k = 0 To UBound(x) Step 16
AA = a
BB = b
CC = c
DD = d

FF a, b, c, d, x(k + 0), S11, &HD76AA478
FF d, a, b, c, x(k + 1), S12, &HE8C7B756
FF c, d, a, b, x(k + 2), S13, &H242070DB
FF b, c, d, a, x(k + 3), S14, &HC1BDCEEE
FF a, b, c, d, x(k + 4), S11, &HF57C0FAF
FF d, a, b, c, x(k + 5), S12, &H4787C62A
FF c, d, a, b, x(k + 6), S13, &HA8304613
FF b, c, d, a, x(k + 7), S14, &HFD469501
FF a, b, c, d, x(k + 8), S11, &H698098D8
FF d, a, b, c, x(k + 9), S12, &H8B44F7AF
FF c, d, a, b, x(k + 10), S13, &HFFFF5BB1
FF b, c, d, a, x(k + 11), S14, &H895CD7BE
FF a, b, c, d, x(k + 12), S11, &H6B901122
FF d, a, b, c, x(k + 13), S12, &HFD987193
FF c, d, a, b, x(k + 14), S13, &HA679438E
FF b, c, d, a, x(k + 15), S14, &H49B40821

GG a, b, c, d, x(k + 1), S21, &HF61E2562
GG d, a, b, c, x(k + 6), S22, &HC040B340
GG c, d, a, b, x(k + 11), S23, &H265E5A51
GG b, c, d, a, x(k + 0), S24, &HE9B6C7AA
GG a, b, c, d, x(k + 5), S21, &HD62F105D
GG d, a, b, c, x(k + 10), S22, &H2441453
GG c, d, a, b, x(k + 15), S23, &HD8A1E681
GG b, c, d, a, x(k + 4), S24, &HE7D3FBC8
GG a, b, c, d, x(k + 9), S21, &H21E1CDE6
GG d, a, b, c, x(k + 14), S22, &HC33707D6
GG c, d, a, b, x(k + 3), S23, &HF4D50D87
GG b, c, d, a, x(k + 8), S24, &H455A14ED
GG a, b, c, d, x(k + 13), S21, &HA9E3E905
GG d, a, b, c, x(k + 2), S22, &HFCEFA3F8
GG c, d, a, b, x(k + 7), S23, &H676F02D9
GG b, c, d, a, x(k + 12), S24, &H8D2A4C8A

HH a, b, c, d, x(k + 5), S31, &HFFFA3942
HH d, a, b, c, x(k + 8), S32, &H8771F681
HH c, d, a, b, x(k + 11), S33, &H6D9D6122
HH b, c, d, a, x(k + 14), S34, &HFDE5380C
HH a, b, c, d, x(k + 1), S31, &HA4BEEA44
HH d, a, b, c, x(k + 4), S32, &H4BDECFA9
HH c, d, a, b, x(k + 7), S33, &HF6BB4B60
HH b, c, d, a, x(k + 10), S34, &HBEBFBC70
HH a, b, c, d, x(k + 13), S31, &H289B7EC6
HH d, a, b, c, x(k + 0), S32, &HEAA127FA
HH c, d, a, b, x(k + 3), S33, &HD4EF3085
HH b, c, d, a, x(k + 6), S34, &H4881D05
HH a, b, c, d, x(k + 9), S31, &HD9D4D039
HH d, a, b, c, x(k + 12), S32, &HE6DB99E5
HH c, d, a, b, x(k + 15), S33, &H1FA27CF8
HH b, c, d, a, x(k + 2), S34, &HC4AC5665

II a, b, c, d, x(k + 0), S41, &HF4292244
II d, a, b, c, x(k + 7), S42, &H432AFF97
II c, d, a, b, x(k + 14), S43, &HAB9423A7
II b, c, d, a, x(k + 5), S44, &HFC93A039
II a, b, c, d, x(k + 12), S41, &H655B59C3
II d, a, b, c, x(k + 3), S42, &H8F0CCC92
II c, d, a, b, x(k + 10), S43, &HFFEFF47D
II b, c, d, a, x(k + 1), S44, &H85845DD1
II a, b, c, d, x(k + 8), S41, &H6FA87E4F
II d, a, b, c, x(k + 15), S42, &HFE2CE6E0
II c, d, a, b, x(k + 6), S43, &HA3014314
II b, c, d, a, x(k + 13), S44, &H4E0811A1
II a, b, c, d, x(k + 4), S41, &HF7537E82
II d, a, b, c, x(k + 11), S42, &HBD3AF235
II c, d, a, b, x(k + 2), S43, &H2AD7D2BB
II b, c, d, a, x(k + 9), S44, &HEB86D391

a = AddUnsigned(a, AA)
b = AddUnsigned(b, BB)
c = AddUnsigned(c, CC)
d = AddUnsigned(d, DD)
Next

MD5 = LCase(WordToHex(a) & WordToHex(b) & WordToHex(c) & WordToHex(d))
End Function 条形码代码请参考Gu版的帖子
http://bbs.mjtd.com/thread-89727-1-1.html

war32 发表于 2018-1-30 23:54:43

;更新模块
;当版本文件存在则读取服务器版本号
(setq dver "3.0.0.0") ;当前版本号
(if (setq file (open "\\\\192.168.1.11\\1\\ver.txt" "r"))
(progn (setq xver (read-line file))(close file)
   
    ;将版本号去小数点后连在一起作为数字处理,比较其大小得到是否有新版本
    (while (vl-string-search "." dver)
      (setq dver (vl-string-subst "" "." dver))
    )
    (while (vl-string-search "." xver)
      (setq xver (vl-string-subst "" "." xver))
    )
    (if (< dver xver)
      (progn
      (setq fso (vlax-create-object "Scripting.FileSystemObject"))
      (setq newfile (vlax-invoke-method fso 'getfile "\\\\192.168.1.11\\1\\1.vlx"))
      (vlax-invoke-method newfile 'copy "D:\\cad.vlx" :vlax-true)
      (princ (strcat "\n\t更新完成,新版本号为:V" xver "。请重启CAD以完成更新!"))
      (setq file nil xver nil dver nil fso nil newfile nil)
      )
      (princ (strcat "\n\t 插件V" dver "已加载."))
      
    )
)
(princ (strcat "\n\t 插件V" dver "已加载."))
)

;更新模块结束
猫老师,在采用自动更新模块的时候出现一个问题,当服务器关机而客户机网络连接存在时,会耗费很长的时间来判断服务器不存在,从而导致程序在加载的时候非常耗时,有没有什么办法能解决呢。以下是我判断版本的代码。

war32 发表于 2017-12-28 13:26:54

留个脚印,以后慢慢研究。
重点关注在自动更新,目前的原理是比较两个文件,但前提是文件名没有经过更改,能否判断更改以后的vlx文件名,从而与新的文件进行比较?

不死猫 发表于 2014-6-13 13:09:08

本帖最后由 不死猫 于 2014-6-13 17:59 编辑

其中Oracle在客户端访问的驱动,可以安装Oracle Database Instant Client(自己百度)
opendcl基于7.0版本
对话框文件


sgyplot.txt586.1402,1080.5659
1006.3402,1377.7659
1
10
1
1
1
1
西丽
1
0

lucas_3333 发表于 2014-6-13 13:39:38

本帖最后由 lucas_3333 于 2014-6-13 13:41 编辑

占楼留名,哈哈,太高深,N年后再来看

cable2004 发表于 2014-6-13 13:48:08

猫老师大作!

叶曲冰寒 发表于 2014-6-13 17:50:00

看样子我要再等十年才看的懂!

AbnerXk 发表于 2014-6-13 21:51:06

太高深,N年后再来看...

longer1000 发表于 2014-6-14 09:06:38

太高深,

lostbalance 发表于 2014-6-14 19:53:25

完全看不懂啊

biscxz 发表于 2014-6-15 08:50:32

高手中的高手,佩服。。。

artken 发表于 2014-6-15 14:48:45

高手中的高手,佩服。。。
页: [1] 2 3 4
查看完整版本: OpenDCL、打印设定、文件上传、oracle数据库、sql数据库、程序自动更新、MD5加密等