自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(55)
  • 资源 (21)
  • 收藏
  • 关注

原创 使用echarts加载自定义地图方法_hanCSDN_20201112

1.去网站描绘出坐标点http://geojson.io/#map=13/30.2726/120.12372.生成json文件{ "type": "FeatureCollection", "features": [{ "type": "Feature", "properties": { "name": "xx区" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ //拷贝开始,这行去掉 [ 120.1550674438476

2020-11-12 11:12:12 651 1

原创 logback配置 (分文件夹、可配路径)_hanCSDN_20180906

相关连接:https://www.cnblogs.com/lixuwu/p/5804793.htmlhttps://www.cnblogs.com/linkstar/p/8309039.htmlhttps://blog.csdn.net/qq_29689487/article/details/78397562https://ask.csdn.net/questions/643004...

2018-09-06 14:27:37 1603

原创 jconsole远程连接springboot启动命令_hanCSDN_20180906

nohup java -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenti...

2018-09-06 14:26:45 1610

原创 mybatis通用主键uuid配置_hanCSDN_20180906

package com.hzdaba.config.myBatis; import org.springframework.context.annotation.Bean;import tk.mybatis.spring.mapper.MapperScannerConfigurer; import java.util.Properties; public class M...

2018-09-06 14:25:07 1106

原创 Oracle遍历子节点_hanCSDN_20150319

select * from gis_module where id=(select id from gis_module where display_name like '%人口%') union select * from gis_module start with parent_id=(select id from gis_module where display_name lik

2015-03-19 09:13:55 657

原创 bat脚本执行jar包_hanCSDN_20130909

1.执行jar.bat@echo offset exe_path=C:\Documents and Settings\Administrator\桌面\Eclipse打包成JAR包读取外部JAR包和外部配置文件set exe_name=myUtil.jar::echo 执行开始时间::date/t::time/techo ************************

2013-09-09 13:49:25 933

原创 bat脚本显示当前时间_hanCSDN_20130909

@echo offset c=%date:~0,10% %time:~0,8%echo 显示现在时间,格式为yyyy-MM-dd HH:mm:ssecho %c%pause

2013-09-09 13:47:43 905

原创 用脚本执行eclipse打包好的JAR包_hanCSDN_20130823

1.执行jar.bat@echo offset exe_path=C:\Documents and Settings\Administrator\桌面\Eclipse打包成JAR包读取外部JAR包和外部配置文件set exe_name=myUtil.jar::echo 执行开始时间::date/t::time/techo ******************************

2013-08-23 14:15:11 643

原创 jdbc连接oracle报错_hanCSDN_20130821

驱动问题。更新驱动版本。

2013-08-21 09:39:08 549

原创 用Eclipse打包jar程序直接运行(3.Eclipse打包总结)_hanCSDN_20130821

总结:

2013-08-21 09:36:57 567

原创 用Eclipse打包jar程序直接运行(2.Eclipse打包步骤)_hanCSDN_20130818

1.右键项目工程----Export---->选择Java下JAR File,下一步2.选择工程的src目录(其他的lib,setting都不选中),去掉两个配置文件的选项(配置文件外部读取),选择导出的JAR包的位置,下一步3.下一步4.选中自定义在manifest.mf,完成5.运行,在myUtil.jar的目录下,把lib文件夹和config文件夹co

2013-08-18 12:40:00 694

原创 用Eclipse打包jar程序直接运行(1.源码)_hanCSDN_20130817

1.编写java程序。package com.my.util;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;public class MyDBUtil { private String driverCl

2013-08-17 21:49:00 848

原创 java通过线程控制程序执行超时(新)_hanCSDN_20130816

为了解决方法中有基本数据类型8种基本数据类型,short,int,long,float,double,byte,char,booleanpackage com.common;public class Args_Method { private Object[] obj; //对象 private Class[] clazz; //类型 public Args_Metho

2013-08-16 15:56:09 696

转载 ORACLE9i客户端连11G服务端DBLINK报用户名密码错误_hanCSDN_20130816

一、创建dblink 原始语句:  create public database link xxxx  connect to abc identified by abc  using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.xxx.xxx.xxx)(PORT = 1521)))(CONNE

2013-08-16 15:51:43 2137

原创 java定时器Timer的简单例子_hanCSDN_20130815

package com.test;import java.io.IOException;import java.util.Timer;public class Test8 { public static void main(String[] args) { Timer timer = new Timer(); timer.scheduleAtFixedR

2013-08-15 15:28:47 508

原创 java通过线程控制程序执行超时_hanCSDN_20130815

package com.common;public class InArgs_MyRunner { private Object classNewInstance; // 使用的对象 private String methodname; // 调用的方法名 private Object[] args; // 调用的参数 private String breakMethodn

2013-08-15 15:20:14 666

原创 javascript设置Cookie和获取Cookie_hanCSDN_20130808

//在这里可以对cookie的内容进行读写//name:cookie名称,value:对应的值,expires有效天数,path生效目录function SetCookie(name,value,path,expires){ var c_name = ""; var c_value = ""; var c_path = ""; var c_e

2013-08-08 15:00:05 1075

原创 ORACLE_1158/em控制台管理锁_hanCSDN_20130808

1.控制台登录地址:http://localhost:1158/em2.点击性能。3.选择实例锁。4.选择所有实例锁。5.选中需要解锁的条目。终止回话。

2013-08-08 13:59:12 777

原创 JAVA自定义注解_hanCSDN_20130802

package com.test;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;import java.lang.annotation.ElementType;@Retention(Ret

2013-08-02 16:19:13 796

原创 Flash Player 设置管理器_hanCSDN_20130722

Flash Player 设置管理器地址: http://www.macromedia.com/support/documentation/cn/flashplayer/help/settings_manager02.html全局安全性设置面板 - 选中“始终允许”然后点击“添加位置”- 在“信任此位置”文本框中输入信任的文件、文件夹、或是盘符路径,那么这些路径所指位置的Falsh将不会弹

2013-07-22 18:05:07 713

原创 javaSocket客户端和服务端_hanCSDN_20130711

客户端:try{ System.out.println(SocketIP+"---"+SocketPort); socket = new Socket(SocketIP,SocketPort); in = new BufferedReader(new InputStreamReader(socket.getInputStream())); out = new P

2013-07-11 16:47:15 635

原创 Oracle根据开始结束日期循环打印中间的日期_hanCSDN_201306014

declare   p_date varchar2(32);  p_nextdate varchar2(32);  p_lastdate varchar2(32);  p_date_date date;  p_nextdate_date date;begin  p_date :='2013-05-01';  p_lastdate:='2013-05-31';

2013-06-14 16:43:33 1956

转载 Oracle trunc()函数的用法_hanCSDN_20130609

--Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual  --2011-3-18  今天的日期为2011-3-182.select trunc(sysdate, 'mm')   from   dual  --2011-3-1    返回当月第一天.3.s

2013-06-09 15:38:57 508

原创 JAVA文件读写操作_hanCSDN_20130609

package com.test;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileWr

2013-06-09 14:24:11 477

转载 Oracle存储过程(表)无法编译被锁住解决办法_hanCSDN_20130605

可用SYS登录,然后查询如下语句:查找存储过程OPERATIONDATA_IMP被哪些session锁住而无法编译select * FROM dba_ddl_locks where name =upper('OPERATIONDATA_IMP');从而得到session_id,然后通过select t.sid,t.serial# from v$session t where

2013-06-05 16:23:00 903

转载 Oracle时间格式_hanCSDN_20130604

1:取得当前日期是本月的第几周 SQL> select to_char(sysdate,'YYYYMMDD W HH24:MI:SS') from dual; TO_CHAR(SYSDATE,'YY ------------------- 20030327 4 18:16:09 SQL> select to_char(sysdate,'W') from dual; T

2013-06-04 10:18:40 670

转载 Oracle闪回作用_hanCSDN_20130603

闪回作用 自动的基于磁盘的备份与恢复,能把表恢复到过去的某个时间点查看闪回区 Show parameter db_recovery_file_dest;查看闪回区详细信息 Select flashback_on from v$database;查看闪回区是否开启 2,修改闪回功能SQL> startup mount 数据库启动到mount下 SQL>

2013-06-03 16:09:10 573

原创 Windows下查看端口占用并结束相应进程_hanCSDN_20130517

在windows命令行窗口下执行: 1.查看所有的端口占用情况C:\>netstat -ano 2.查看指定端口的占用情况C:\>netstat -aon|findstr "9050"  3.查看PID对应的进程C:\>tasklist|findstr "2016"  4.结束该进程C:\>taskkill /f /t /im tor.exe

2013-05-17 10:32:51 483

原创 ORACLE使用case语句_hanCSDN_20130514

select t.*, case t.colname when 'condition1' then 'new1' when 'condition2' then 'new2' else 'others' end as newname

2013-05-14 21:49:40 658

转载 HttpClient在使用中有两个超时时间_hanCSDN_20130506

HttpClient在使用中有两个超时时间,是一直接触和使用的,由于上次工作中使用httpClient造成了系统悲剧的情况,特地对它的两个超时时间进行了小小的测试,在这里记录下。     测试版本为HttpClient——3.1     一:连接超时:connectionTimeout     1:指的是连接一个url的连接等待时间。     2:设置方法为:

2013-05-06 22:54:23 816

原创 DBCP连接池BasicDataSource_hanCSDN_20130504

import javax.sql.DataSource;import java.sql.Connection;import java.sql.Statement;import java.sql.ResultSet;import java.sql.SQLException;import org.apache.commons.dbcp2.BasicDataSource;public

2013-05-04 12:03:37 650

原创 oracle根据当前日期截取一周时间_hanCSDN_20130503

declarebegindate date;enddate date;daystr varchar2(20);begin  select to_char(sysdate,'day') into daystr from dual;  if(daystr='星期一') then           begindate :=sysdate;           endda

2013-05-03 10:39:09 698

原创 java数据库连接池_hanCSDN_20130428

/** * */import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;import org.apache.commons.dbcp.BasicDataSource;import com.zr

2013-04-28 15:27:00 877

转载 Log4j配置_hanCSDN_20130427

在项目中的classes 中新建立一个log4j.properties文件即可; 在实际编程时,要使Log4j真正在系统中运行事先还要对配置文件进行定义。定义步骤就是对Logger、Appender及Layout的分别使用。Log4j支持两种配置文件格式,一种是XML格式的文件,一种是java properties(key=value)【Java特性文件(键=值)】。(这里只说明prope

2013-04-27 22:17:41 447

原创 JSON-LIB.JAR转换json格式字符串_hanCSDN_20130427

import java.util.ArrayList;import java.util.Iterator;import java.util.List;import net.sf.ezmorph.object.DateMorpher;import net.sf.json.JSONArray;import net.sf.json.JSONObject;import net.sf

2013-04-27 22:15:25 962

原创 JAVA日志打印_hanCSDN_20130427

import java.io.BufferedWriter;import java.io.FileWriter;public class Log { private static int iMsg = 1; //1 控制台打印 2 写日志文件 private static int iDebug = 2; public Log() {

2013-04-27 15:06:22 710

原创 httpclien调用webservice_hanCSDN_20130427

import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import org.apache.commons.httpclient.HttpClient;import org.apache.commons.httpclient.SimpleHttpConne

2013-04-27 09:39:44 662

原创 JAVA取两个日期之间日期转成字符串_hanCSDN_20130426

public static ArrayList getDateStringList(Date date, Date endDate,int betweenNum,String formatString){ ArrayList list = new ArrayList(); Calendar calendar = Calendar.getInstance(

2013-04-26 18:03:54 657

原创 JAVA取前N天的日期转成字符串_hanCSDN_20130425

import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Calendar;import java.util.Date;public class Test { public static void main(String[]

2013-04-25 21:42:12 607

原创 JAVA程序定时运行_hanCSDN_20130424

1.建一个web工程。2.建立一个Servlet类,并配置web.xml。 wslyjk servletgetwsly com.zrar.servlet.ServletGetWsly 1 servletgetwsly /servletgetwsly index.jsp

2013-04-24 21:29:59 763

Eclipse打包成JAR包读取外部JAR包和外部配置文件(源码)

Eclipse 打包 JAR包 外部配置文件

2013-08-20

Eclipse打包成JAR包读取外部JAR包和外部配置文件

Eclipse打包成JAR包读取外部JAR包和外部配置文件 Eclipse 打包 jar 外部JAR 外部配置文件

2013-08-17

java通过线程控制程序执行超时(新)

java通过线程控制程序执行超时(新) 基本数据类型 反射 线程 超时

2013-08-16

java通过线程控制程序执行超时

java通过线程控制程序执行超时,多线程,反射

2013-08-15

delphi 装饰模式

TPerson = class private Name:string; ListBox:TListBox; public constructor Create(AName:string;AListBox:TListBox); overload; constructor Create;overload; procedure Show;virtual; end; TFinery = class(TPerson) protected Component:TPerson; public procedure Decorator(Acomponent:TPerson); procedure Show;override; end; TShirts = class(TFinery) public procedure Show;override; end; TBigTrouser = class(TFinery) public procedure Show;override; end;

2011-06-21

delphi 简单工厂模式

type TIProduct = class str:string; function Print():string;virtual; end; type TProduct_A = class(TIProduct) private public function Print():string;override; end; type TProduct_B = class(TIProduct) private public function Print():string;override; end; type TSimpleFactory = class private public function CreateProduct(A:string):TIProduct; end;

2011-06-20

delphi 隐藏字符*的获取

unit UnitMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Edit1: TEdit; Button1: TButton; Label2: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var buffer:PChar;//存储空间 L:Integer;//密码框内容的长度 begin L:=GetWindowTextLength(Edit1.Handle);//取密码框内容的长度 GetMem(buffer,L+1);//分配内存空间,注意加1,因为ASCII码以"\0"结尾 SendMessage(Edit1.Handle,WM_GETTEXT,L+1,Integer(buffer)); Label2.Caption:=string(buffer);//显示 FreeMem(buffer);//释放内存 end; end.

2011-05-17

API 删除到回收站

function RecycleFile(sFileName:string):Boolean; var FOS:TSHFileOpStruct; begin FillChar(FOS,SizeOf(FOS),0);{记录清零} with FOS do begin wFunc:=FO_DELETE; //删除 pFrom:=PChar(sFileName); fFlags:=FOF_ALLOWUNDO; //移入回收站,而不是物理删除 end; Result:=(SHFileOperation(FOS)=0); end;

2011-05-17

delphi_遍历文件夹

while SRI = 0 do begin if (SR.Name = '.') or (SR.Name = '..') then begin //不用做 end else if SR.Attr = faDirectory then begin if CheckBox1.Checked then begin Start(APath + '\' + sr.Name, SR.Name, ndRoot); end; end else begin Num := Num + 1; Label2.Caption := IntToStr(Num); ListBox1.Items.Add(SR.Name); nd := TreeView1.Items.AddChild(ndRoot, SR.Name); end; SRI := FindNext(SR); end;

2011-03-24

delphi_只允许运行一个exe实例

program OnlyOne; uses Forms, Windows, Dialogs, UnitMain in 'UnitMain.pas' {Form1}; resourcestring FMutex = 'MUTEX_ONLY_ONE'; //互斥对象名 {$R *.res} var hMutex:HWND; iRet:Integer; begin

2011-03-23

delphi_随机滚动_抽奖

unit UnitMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, math, Buttons; type TRandomForm = class(TForm) Button1: TButton; Timer1: TTimer; EditPath: TEdit; ListBox1: TListBox; Button2: TButton; SpeedButton1: TSpeedButton; EditName: TEdit; OpenDialog: TOpenDialog; procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Button1KeyPress(Sender: TObject; var Key: Char); procedure FormShow(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private s: TStringList; //从文件中读取数据 Current: Integer; //随机数产生的序号 Num: Integer; //数组中的数量 I: Integer; //序号 public // procedure LoadFile; // 装载文件 procedure GetNameValue; end;

2011-03-23

InstallShield_新建Dialog

InstallShield_新建Dialog

2011-01-26

delphi_钩子截获鼠标操作

var Form1: TForm1; Hook:HHOOK; PlayHook:HHOOK; PlayLog:Integer; EventLog:Integer; EventArr:array[0..1000]of EVENTMSG; //记录鼠标时间 bDelay:Bool; implementation {$R *.dfm} function HookProc(iCode:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT;stdcall; begin Result:=0; if iCode =1000 then begin UnHookWindowsHookEx(Hook); end; end; end; function HookPlayBack(iCode:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT;stdcall; begin Result:=0; if iCode=EventLog then begin UNHookWindowsHookEx(PlayHook); end; end;

2011-01-25

delphi_键盘记录例子

unit keyboard_hook; interface uses Windows,Messages; const WM_HookKEY=WM_USER+$1000; procedure HookOn;stdcall; procedure HookOff;stdcall; implementation var Hook:HHOOK; FileMapHandle:THandle; PViewInteger:^Integer; function CallHook(iCode:Integer;wParam:WPARAM;lParam:LPARAM):LRESULT;stdcall; begin if iCode=HC_ACTION then begin //打开映像文件 FileMapHandle:=OpenFileMapping(FILE_MAP_READ,False,'TestHook'); if FileMapHandle0 then begin //映射入内存中 PViewInteger:=MapViewOfFile(FileMapHandle,FILE_MAP_READ,0,0,0); //PViewInteger指向主程序句柄,WM_HookKEY是自定义消息 PostMessage(PViewInteger^,WM_HookKEY,wParam,lParam); UnmapViewOfFile(PViewInteger); CloseHandle(FileMapHandle); end; end; Result:=CallNextHookEx(Hook,iCode,wParam,lParam); end;

2011-01-25

两个DLL文件共享内存数据块

procedure TForm1.Button1Click(Sender: TObject); {设置键盘钩子} begin EnableKeyHook; //设置钩子 Button1.Enabled:=False; Button2.Enabled:=True; Button3.Enabled:=True; button4.Enabled:=True; Panel1.Caption:='键盘钩子已经设置'; end; procedure TForm1.Button2Click(Sender: TObject); begin DisableKeyHook; //卸载钩子 Button1.Enabled:=True; Button2.Enabled:=False; Button3.Enabled:=False; Button4.Enabled:=False; Panel1.Caption:='键盘钩子已经设置'; end;

2011-01-25

delphi_托盘程序

procedure TForm1.FormCreate(Sender: TObject); begin TrayIcon1.Visible:=True; end; procedure TForm1.N1Click(Sender: TObject); begin Application.Terminate; end; procedure TForm1.TrayIcon1DblClick(Sender: TObject); begin Show; end;

2011-01-19

delphi_悬浮窗口

function SetLayeredWindowAttributes(hwnd: HWND; crKey: Longint; bAlpha: byte; dwFlags: longint): longint; stdcall; external user32; //函数声明 implementation {$R *.dfm} procedure TForm1.btnCancelClick(Sender: TObject); begin Form1.Close; Application.Terminate; end; procedure TForm1.btnOkClick(Sender: TObject); begin if Edit1.Text = '' then begin ShowMessage('透明度不能为空!'); Edit1.SetFocus; edit1.SelectAll; Exit; end; //设置透明度 SetTMD(StrToInt(Edit1.Text)); end;

2011-01-19

delphi_XML

unit XMLexample; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, StdCtrls, Buttons, cxContainer, cxListBox, msxmldom, XMLDoc; type TForm1 = class(TForm) XMLDocument1: TXMLDocument; lstSource: TcxListBox; lstTarget: TcxListBox; SpeedButton2: TSpeedButton; SpeedButton1: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton4: TSpeedButton; SpeedButton6: TSpeedButton; SpeedButton5: TSpeedButton; SpeedButton7: TSpeedButton; SpeedButton8: TSpeedButton; Button1: TButton; cxListBox1: TcxListBox; cxListBox2: TcxListBox; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton6Click(Sender: TObject); procedure SpeedButton5Click(Sender: TObject); procedure SpeedButton7Click(Sender: TObject); private { Private declarations } public procedure MoveUp(A: TcxListBox); //上移 procedure MoveDown(A: TcxListBox); //下移 procedure DeleteItem(A: TcxListBox); //删除 procedure ReLoadItems(A: TcxListBox; const Flag: Integer = 0); //重置 procedure CreateXML(APath:string); end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin CreateXML('C:\Documents and Settings\Administrator\桌面\XML'); end; procedure TForm1.Button2Click(Sender: TObject); var Node: IXMLNode; Root: IXMLNode; //根节点 ParentNode: IXMLNode; //首节点 StrDir: string; xmlDocument: IXMLDocument; I: Integer; begin xmlDocument := TXMLDocument.Create(nil); StrDir := 'C:\Documents and Settings\Administrator\桌面\XMLConfig.xml'; xmlDocument.XML.LoadFromFile(StrDir); xmlDocument.Active := true; Root := xmlDocument.DocumentElement; //源字段 ParentNode:=Root.ChildNodes.FindNode('FieldsFromSource'); for I := 1 to ParentNode.ChildNodes.Count - 1 do begin Node:=ParentNode.ChildNodes[i]; cxListBox1.Items.Add(Node.ChildValues['FieldName']); end; //目标字段 ParentNode:=Root.ChildNodes.FindNode('FieldsFromTarget'); for I := 1 to ParentNode.ChildNodes.Count - 1 do begin Node:=ParentNode.ChildNodes[i]; cxListBox2.Items.Add(Node.ChildValues['FieldName']); end; end; procedure TForm1.CreateXML(APath: string); var xmlDocument: IXMLDocument; sDir: string; i:Integer; begin xmlDocument := TXMLDocument.Create(nil); with xmlDocument.XML do begin //开始写XML Add('<?xml version="1.0" encoding="GB2312"?>'); Add('<Config>'); //源字段信息写入XML if lstSource.Count>0 then begin Add('<FieldsFromSource>'); Add('<Number>' + IntToStr(lstSource.Count) + '</Number>'); for I := 0 to lstSource.Count - 1 do begin Add('<FieldInfo>'); Add('<Sequence>' + IntToStr(i) + '</Sequence>'); Add('<FieldName>'+ lstSource.Items[i]+'</FieldName>'); Add('<DisplayName_CN>'+ ''+'</DisplayName_CN>'); Add('<DisplayName_EN>'+ ''+'</DisplayName_EN>'); Add('<FieldType>'+ ''+'</FieldType>'); Add('<FieldSize>'+ ''+'</FieldSize>'); Add('</FieldInfo>'); end; Add('</FieldsFromSource>'); end else begin Add('<FieldsFromSource>'); Add('<Number>0</Number>'); Add('</FieldsFromSource>'); end; //目标字段写入XML if lstTarget.Count>0 then begin Add('<FieldsFromTarget>'); Add('<Number>' + IntToStr(lstTarget.Count) + '</Number>'); for I := 0 to lstTarget.Count - 1 do begin Add('<FieldInfo>'); Add('<Sequence>' + IntToStr(i) + '</Sequence>'); Add('<FieldName>'+ lstTarget.Items[i]+'</FieldName>'); Add('<DisplayName_CN>'+ ''+'</DisplayName_CN>'); Add('<DisplayName_EN>'+ ''+'</DisplayName_EN>'); Add('<FieldType>'+ ''+'</FieldType>'); Add('<FieldSize>'+ ''+'</FieldSize>'); Add('</FieldInfo>'); end; Add('</FieldsFromTarget>'); end else begin Add('<FieldsFromTarget>'); Add('<Number>0</Number>'); Add('</FieldsFromTarget>'); end; Add('</Config>'); //XML注释 Add('<!--FieldsFromSource 源字段 -->'); Add('<!--FieldsFromTarget 目标字段 -->'); Add('<!--FieldsInfo 字段信息 -->'); Add('<!--Number 字段数量 -->'); Add('<!--Sequence 序号 -->'); Add('<!--FieldName 字段名称 -->'); Add('<!--DisplayName_CN 中文名称 -->'); Add('<!--DisplayName_EN 英文名称 -->'); Add('<!--FieldType 字段类型 -->'); Add('<!--FieldSize 字段长度 -->'); //XML结束 end; xmlDocument.Active := True; sDir := APath; if not DirectoryExists(sDir) then begin if not CreateDir(sDir) then begin ShowMessage('创建文件夹失败'); Exit; end; end; xmlDocument.SaveToFile(sDir + 'Config.xml'); end; procedure TForm1.DeleteItem(A: TcxListBox); var _Index: Integer; begin with A do begin if (Items.Count > 0) and (ItemIndex <> -1) then begin _Index := ItemIndex; Items.Delete(_Index); end; end; end; procedure TForm1.MoveDown(A: TcxListBox); var CurrIndex, LastIndex: Integer; begin with A do begin CurrIndex := ItemIndex; LastIndex := Items.Count; if ItemIndex <> -1 then begin if CurrIndex + 1 < LastIndex then begin Items.Move(ItemIndex, (CurrIndex + 1)); ItemIndex := CurrIndex + 1; end; end; end; end; procedure TForm1.MoveUp(A: TcxListBox); var CurrIndex: Integer; begin with A do begin if ItemIndex > 0 then begin CurrIndex := ItemIndex; Items.Move(ItemIndex, (CurrIndex - 1)); ItemIndex := CurrIndex - 1; end; end; end; procedure TForm1.ReLoadItems(A: TcxListBox; const Flag: Integer); begin end; procedure TForm1.SpeedButton1Click(Sender: TObject); begin MoveDown(lstSource); end; procedure TForm1.SpeedButton2Click(Sender: TObject); begin MoveUp(lstSource); end; procedure TForm1.SpeedButton3Click(Sender: TObject); begin DeleteItem(lstSource); end; procedure TForm1.SpeedButton5Click(Sender: TObject); begin MoveDown(lstTarget); end; procedure TForm1.SpeedButton6Click(Sender: TObject); begin MoveUp(lstTarget); end; procedure TForm1.SpeedButton7Click(Sender: TObject); begin DeleteItem(lstTarget); end; end.

2011-01-19

delphi_进度条

unit FrmProgressUnit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls; type TFrmProgress = class(TForm) ProgressBar: TProgressBar; procedure FormShow(Sender: TObject); private FProgressMin:Integer; FProgressMax:In

2011-01-19

delphi _获取Internet时间

unit GetInternetTime; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComObj, DateUtils; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public function GetInternetTime:string; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var InternetTime:string; begin InternetTime:=GetInternetTime; ShowMessage(InternetTime); end; function TForm1.GetInternetTime:string; var XmlHttp: Variant; datetxt: string; DateLst: TStringList; mon: string; timeGMT, GetNetTime: TDateTime; s: string; begin XmlHttp := CreateOleObject('Microsoft.XMLHTTP'); XmlHttp.Open('Get', 'http://www.baidu.com/', False); XmlHttp.send; datetxt := XmlHttp.getResponseHeader('Date'); datetxt := Copy(datetxt, Pos(',', datetxt) + 1, 100); datetxt := StringReplace(datetxt, 'GMT', '', []); datetxt := Trim(datetxt);

2011-01-19

delphi_dll调用

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxEdit, dxSkinsCore, dxSkinsDefaultPainters, Menus, StdCtrls, cxButtons, cxTextEdit; type TForm1 = class(TForm) cxTextEdit1: TcxTextEdit; cxButton1: TcxButton; procedure cxButton1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TDelphiDllFunc = function(Aint:Integer):Integer;stdcall; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.cxButton1Click(Sender: TObject); var i:Integer; DllHandle:THandle; Func: TDelphiDllFunc; begin DllHandle:=LoadLibrary('project1.dll'); try @Func:=GetProcAddress(DllHandle,'DelphiDll'); if Assigned(@Func) then begin i:=Func(11); cxTextEdit1.Text := IntToStr(i); end; finally FreeLibrary(DLLHandle); end; end; end.

2011-01-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除