Hoplite
ҽ
л
ҵBlog
¹鵵...
·...
...
Ķ...
...
ͳ...
վ...
Դ
===========================================================
˭Ҫ̭35ijԱ
===========================================================
˭Ҫ̭35ijԱ

̳ wcyht234

Ҫ35֮ijԱ͸ṋ̃ҵǡഺ𣿱߸ЩԼĹ۵ͳȻһ֮ԣҲǵһЩ

ؼ֣ITְ Ա ʦ

һ35ijԱ͸ṋ̃

һҵϰ˵ITҵļԱ̭ԲҪ35ļԱҵҵų䳬35ԱҲºܶ๤ʦΪԼ35Ժǰ;תС Ϊܶ˶ΪITҵ˵ҵdzഺ35ûˡ

 鿴ȫ
hoplite :2007.07.21 09:52 ::: ( ) ::Ķ:(104) :: (0) :: (0)
===========================================================
Աְҵչ
===========================================================
Աְҵչ

ÿҵҪԱ֧֣ҵҪֳƺ͹̷ļ˲ţITȸ߿ƼҵҪз豸άӲʦزҪʦľʦʩԱ⣬ǹӪҵʹ˾ҪĻˡܶںд¥officeڹİ죬µĹǺͼصġ

һϾʵǣļԱԼְҵλְҵĹ滮Ե÷dzãйоŻˣˡλȣԱ˿һȣȻŷdzҪļԹǰĻӢ۵Ľɫλ뷽ֹ޵ĸձڲ࣬һʵ˼Աľ޴ڶְҵ滮ԭDzּԹľԡITҵ˵ڼ֪ʶµٶ̫죬Աձ鱻Ϊdzԡഺְλ˭ѧϰĸ졢˭ľʢ˭ܰҹ˭͸оΪʱѾҪ35껹Ļڱְλȡͻơ

ôڼԱ˵ѵǵְҵչǰʵȻ˱ۣͬŷdzĿռ䣬ȻؼһҪԼҰЩӳԶĽǶ⡣ҵľ飬Աְҵ¼ѡ

һΪĿ

ںܶ¼湤Ա˵չΪĿһ൱õĹĿҪʵļ֧֣漰෽ĹʺЩֲֻԱΪĿһԳַӼԱרҵƣͬʱֿŶӹЭԴⲿͨȹͷΪߵĽɫãӶֵΪֵʵֺ͵õϿɡĿ˲ţҲǽܳʱڵһְҵ

Ϊҵר

ȷdzϲóϲ˹ͨȫרעԷչΪҵרΪĿ꣬Ȼһչܻ̿ȽκһĶ⼼˲ŶҪڵҵۻ͸βͶ롣˲ŵһԽԽ㣬ʼķʱѾʼְҵչĻƽʱڡ

Ϊзܼ

ʵϣijЩҵҵзԱĵλǷdzߵġƩ΢ŵǡΪITҵֺ֧зٶȣΪҵҪԴЩҵзžҵսڲٹţҲdzӿƼͼ磬֪Ĺ԰־֣ܹʦܹʦȼְλܹʦְ񼶱൱ڸַּΧӰ£λ˲ź쵼ͬ𾴡ԣһغӼҵҵУչΪзܼܹʦһܺõѡ

ġۺͷ

ʵdz㷺оչDZ󣬿Կתۻַ֧档Ϊ˵ͨż˾ԱDzרҵģ׹ĵͷгƹ㣬һǴ۹ʦݷÿͻʼġ߼ֵ߿ƼIJƷƹ㣬dzҪзḻԱ

ԱתۺҲǷdzǰ;ġʶһѣѧʩеרҵҵһֱҵǿڶʩڼĹл˷ḻĵ¶豸Ӧúά޾飬һʵĻ۵Ķ豸̣¹˹˾Ϊۺ񹤳ʦϵӦ֣Ҳ

塢תλ

һЩˣȻƳżλƺǾй츳ˡЩ˻ڹչֳDZʺ쵼ϲ˴򽻵ϲ繵ͨ£ԼΪУʵѧϰЩ֪ʶְMBAʱգȫԳɳΪɫְҵˡ

߼Ա

ղ̸ְҵչȺΪУרҵʿڶеרѧУУҵһ߼˵ΪҵרһзܼĻȻdz΢СһȺְҵʿѵļչ·㱾ְλΪ߼ͼԱ

2006̨ĸλָ۸У߼ʦҵĹʱȲʿҪ߳500Ԫһԭܼ򵥣ȫ˵ҵȻ޴󣬵߼ıȴdzС߼ȱѾΪԼҵչġƿ߻ҵʶǶȺƷIJϸƣһ𲽵õı䣬ԳΪи߼ʦһdzǰ;ְҵչ

ٴITҵΪ̸̸Աְҵ켣

IT(Information Technology)ҵķ൱ӣ͵:

һͨ˵DZ̡ʵΪԱЬеĹ˴һλҵƷ(Ȼûб)

ڶMIS: Management Information Service/SystemϢϵͳҪIT衢硢ͨѶӲ֧֡򵥿ְܣΪ˾ṩIT

ERP: Enterprise Resource PlanningҵԴƻϵͳҪ漰ҵʵʩάͨϢֶҵʵʵҵԴЭҵҵĹ淶ҵĹкܴ

ֱ𿴿Աְҵչռ䣺

1. Ա

ҵĹ۵ǣСҵܿһ·ڴ¿һ㴦㣬ιԱĻ᲻󡣶һҪйĿǰҵĻܲã֮ǰ̸Ļڳഺ30ͺȥˡ40ĿԱ䡣ȻҵԽԽܻITԽԽԶ칤˷չ

ҪӦһõƽ̨ǽҵͷҵݷļǿԿתڵӺͨ豸ƣԴӼ򵥵ij򿪷תͨŲƷĿ

2. MISԱ

MISݹ㷺ɴµְҵܶ:ܡֵ֧ȣͨŬԵõΪСС(ȻҪ)ΪMIS ManagerMIS ManagerҲ͵ͷˣǿԿתͬҵҵMIS

ͬITڲͬ˾ITŵĵλǷdz޴ġ˽ģŷй˾ITž100ˣڹ˾ܲĸְܲеĵλ൱ߣϷչ˾ITžȻﵽ800ˣģѾԶԶһIT˾ITŵܲҲǹ˾߲ҪԱԣЩ˾ITֹ֧ȱ˴ʽԱġơı棬ҲصITҵĭΣ

3. ERPԱ

ҵԱһȽϸ(˾ͱȽϸ)ҪԲ۵̶ʶҵԱһΪITпDzԱԱתжITѸٷչҵӪIJչΪERPƹͷչõķչռ䡣ʵϣһҵļԱȫʤһҵĹߣһԱǰ˵Ƿdzġ

ʶһλѣƶǹҵװרҵҵһֱERPӦƹ͹ѯȻԴIT˽Ⲣر̣ERPϵͳҵеӦ÷澭dzḻڱһѯʦѾһרҼڸ뷽Ҳdzɹۡ


hoplite :2007.03.21 15:58 ::: ( ) ::Ķ:(150) :: Permanent link :: (0)
===========================================================
Ա롰Ա
===========================================================
Ա롰Ա 鿴ȫ
hoplite :2007.02.26 20:22 ::: ( ) ::Ķ:(109) :: (0) :: (0)
===========================================================
ͼMIDASеĴ
===========================================================

ͼMIDASеĴ
ύ:2004-3-21 ߣ޽  Email: jacktcx@163.com
 
ؼ:ͼ MIDAS 
/////////////////////////////////////////////////////
// Pic_conversion.pas
//  ܣͼ(.jpg)MIDASпͻ˵Ĵ
//  дʱ䣺2003.12.4
 
//  ˼룺Base 64 Encoding/Decodingе
//            EncodeString/DecodeString ͼ(.jpg)
//            /תΪStringͽд
//
//  function EncodeString(const Input: string): string;
//  function DecodeString(const Input: string): string;
/////////////////////////////////////////////////////


unit Pic_conversion;

interface

uses
 SysUtils, Classes, jpeg, EncdDecd;

type
 TPic = class(Tobject)
 private
   FFilename: String; // ͼ(.jpg)ļλ
   function GetFilename: String;
   procedure SetFilename(Value: String);
 public
   property Filename : String read GetFilename write SetFilename;

   function PictoStream(var Ffilename: String): String;
   procedure StreamtoPic(var target: String);
 end;

implementation

{ TPic }

function TPic.GetFilename: String;
begin
 Result := FFilename;
end;

// תΪͼƬļ ˵
procedure TPic.StreamtoPic(var target: String);
var ams : TmemoryStream;
   ass : TstringStream;
begin
 ass := TStringStream.Create(DecodeString(target)); // Base 64תString
 ams := TmemoryStream.Create;
 try
   ams.LoadFromStream(ass);
   ams.SaveToFile('c:temp.jpg');
 finally
   ass.Free;
   ams.Free;
 end;
end;

procedure TPic.SetFilename(Value: String);
begin
 if Value <> '' then FFilename := Value;
end;

// ͼƬļתΪ  ͻ˵
function TPic.PictoStream(var Ffilename: String): String;
var ass : TstringStream;
   ams : TmemoryStream;
begin
 ams := TmemoryStream.Create;
 ass := Tstringstream.Create('');
 try
   ams.LoadFromFile(Ffilename);
   ams.SaveToStream(ass);
   Result := EncodeString(ass.DataString); //Stirng Base 64
 finally
   ams.Free;
   ass.Free;
 end;
end;

end. 
 


hoplite :2005.01.18 13:03 ::: ( ) ::Ķ:(402) :: (0) :: (0)
===========================================================
DBGrid Ӧȫ
===========================================================

DBGrid Ӧȫ
ύ:2003-11-16 ߣ: archonwang
 
ؼ:DBGrid 
   Delphi ԵݿУDBGrid ʾݵҪֶ֮һ DBGrid ȱʡδԵõȱ⡣ʵȫǵijͨﵽDBGrid ۵Ŀġ̣ͨǿԸı DBGrid ıͷߵǰɫͱɫԼصĴСͷ
   µʾʾ˶ DBGrid Եãʹ Delphi ʾıҳеıһƯۡ
   ʾУ
   Form1 Ϸ DBGrid1Query1DataSource1 ݿصԣʹ DBGrid1 ʾеݡȻ DBGrid1 onDrawColumnCell ¼м´룬Ȼг򣬾ͿԿĽˡ Windows98Delphi5.0 µͨ
procedure TMainForm.DBGrid1DrawColumnCell(Sender: TObject;
 const Rect: TRect; DataCol: Integer; Column: TColumn;State: TGridDrawState);
var i :integer;
begin
 if gdSelected in State then Exit;
//ͷͱɫ
   for i :=0 to (Sender as TDBGrid).Columns.Count-1 do
   begin
     (Sender as TDBGrid).Columns[i].Title.Font.Name :=''; //
     (Sender as TDBGrid).Columns[i].Title.Font.Size :=9; //С
     (Sender as TDBGrid).Columns[i].Title.Font.Color :=$000000ff; //ɫ(ɫ)
     (Sender as TDBGrid).Columns[i].Title.Color :=$0000ff00; //ɫ(ɫ)
   end;
//иı񱳾ɫ
 if Query1.RecNo mod 2 = 0 then
   (Sender as TDBGrid).Canvas.Brush.Color := clInfoBk //屳ɫ
 else
   (Sender as TDBGrid).Canvas.Brush.Color := RGB(191, 255, 223); //屳ɫ
//ߵɫ
   DBGrid1.DefaultDrawColumnCell(Rect,DataCol,Column,State);
 with (Sender as TDBGrid).Canvas do // cell ı߿
 begin
   Pen.Color := $00ff0000; //廭ɫ(ɫ)
   MoveTo(Rect.Left, Rect.Bottom); //ʶλ
   LineTo(Rect.Right, Rect.Bottom); //ɫĺ
   Pen.Color := $0000ff00; //廭ɫ(ɫ)
   MoveTo(Rect.Right, Rect.Top); //ʶλ
   LineTo(Rect.Right, Rect.Bottom); //ɫ
 end;
end;


иıDBGridɫ
   Form1 Ϸ DBGrid1Query1DataSource1 ݿصԣʹ DBGrid1 ʾеݡȻ DBGrid1 onDrawColumnCell ¼м´룬Ȼг

:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);

var i:integer;
begin
 if gdSelected in State then Exit;  //иı񱳾ɫ
   if adoQuery1.RecNo mod 2 = 0 then
     (Sender as TDBGrid).Canvas.Brush.Color := clinfobk //屳ɫ
 else
   (Sender as TDBGrid).Canvas.Brush.Color := RGB(191, 255, 223);  //屳ɫ

 //ߵɫ
 DBGrid1.DefaultDrawColumnCell(Rect,DataCol,Column,State);
 with (Sender as TDBGrid).Canvas do // cell ı߿
 begin
   Pen.Color := $00ff0000; //廭ɫ(ɫ)
   MoveTo(Rect.Left, Rect.Bottom); //ʶλ
   LineTo(Rect.Right, Rect.Bottom); //ɫĺ
   Pen.Color := clbtnface; //廭ɫ(ɫ)
   MoveTo(Rect.Right, Rect.Top); //ʶλ
   LineTo(Rect.Right, Rect.Bottom); //ɫ
 end;
end;

BDEеtable1δͨɫûиб仯 

 

DelphiDBGridв

   Delphiṩ˹ǿ DBGridԷݿӦóơǽDBGridÿһý㣨Gridֻһ򵥵ı༭򣬲ûݡDelphiҲṩһЩû룬DBComboBoxDBCheckBoxЩȴûDBGridǿDelphiܲVisual FoxproDBGridлýԷûأʵǿͨDBGridвʵһ㡣

   DelphiDBGridڲƣϸһDBEditݵʵǸDBEditδýطͼˡԣDBGridвϸһκӼ򵥵DbCheckBoxӵĶԻ򣬶DBGridв롣һDBGridвDBComboBoxIJ裬ͬİ취Բ

 1Delphi 4.0½һĿ

 2ֱ϶Data AccessDataSourceTableData ControlsDBGridDBComboBoxĸForm1ϡ

 3ø£

rcf1 趨ֲ
Form1 Caption 'DBGridвSpinEditʾ'
DataSource1 DataSet Table1
Table1 DatabaseName DBDEMOS
TableName 'teacher.DBF'
Active True
DBGrid1 DataSource DataSource1
DBComboBox1 DataField SEX
DataSource DataSource1
Visible False
Strings Items. ''| 'Ů'

ע⣺Teacher.dbfǷӳְԱֻǡСǡŮ

 4DrawDataCell¼ǻƵԪ񣬵ýӦֶϿӦֶһʱƶϿ򵽻ýϣʹϿӣӶﵽDBGridָʾDBComboBoxĹܡDBGrid1OnDrawDataCell¼£

procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);
begin
 if (gdFocused in State) then
 begin
   if (Field.FieldName = DBComboBox1.DataField ) then
   begin
     DBComboBox1.Left := Rect.Left + DBGrid1.Left;
     DBComboBox1.Top := Rect.Top + DBGrid1.top;
     DBComboBox1.Width := Rect.Right - Rect.Left;
     DBComboBox1.Height := Rect.Bottom - Rect.Top;
     DBComboBox1.Visible := True;
   end;
 end;
end;

 5DBGridָԪδýʱʾDBComboBoxDBGrid1OnColExit¼£
procedure TForm1.DBGrid1ColExit(Sender: TObject);
begin
 If DBGrid1.SelectedField.FieldName = DBComboBox1.DataField then
   begin
     DBComboBox1.Visible := false;
   end;
end;

 6DBGridָлýʱDrawDataCell¼ֻǻƵԪ񣬲ʾDBComboBoxDBComboBoxûлý㣬ݵ뻹ڵԪϽСDBGrid1KeyPress¼еSendMessage Windows API봫䵽DBComboBoxϣӶﵽDBComboBoxϽ롣˻ҪKeyPress¼£

procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
 if (key < > chr(9)) then
 begin
   if (DBGrid1.SelectedField.FieldName =DBComboBox1.DataField) then
   begin
     DBComboBox1.SetFocus;
     SendMessage(DBComboBox1.HandleWM_Charword(Key)0);
   end;
 end;
end;

   Windows 98Delphi 4.015 µͨ

 

DBGridߵ
   ʹ Delphi3 ݿ̵ʱϣ DBGRID ʾݵʱFoxPro BROWSE һָļвйӦʲôʵ֣

   ֪ Delphi TStringGrid һ FixedCols ָСȻTDBGrid ֱʹһԣͨǿתҲһܣΪ඼ TCustomGrid ࡣ Delphi 3.0 DemosDbCtrlGrid Ϊ˵÷ӵ TFmCtrlGrid.FormShow мһУ

   TStringGrid(DbGrid1).FixedCols := 2;

   иóƶʱSymbol вƶַҲԲķ Form ּ

   type TMyGrid = Class(TDBGrid) end;

   Ȼ TFmCtrlGrid.FormShow м룺

   TMyGrid(DbGrid1).FixedCols := 2;

   ߴʽвͬʵʶһġ FixedCols Ϊ 2Ϊ DBGrid иָʾУ㽫 DBGrid Options Ե dgIndicator ΪFalseӦ FixedCols Ϊ1

 

ʹdbgridijϱɫ

   DBGrid Ԫ DrawDataCell ¼ϵıӻֵɫ.
:

OnDrawDataCell(...)
begin
 with TDBGrid(Sender) do
 begin
   if () then
     Canvas.TextOut(Rect.Left + 4
   Rect.Top + 2

'Ҫʾ');
end;

   ῴ DBGrid ʾصΪԭDBGridҪʾ TextOut ʾص
   :
   Query Ԫλ(ԪϰҼ Add Fields...ѡ)ڲҪʾϵλ OnGetText ¼һ趨Ϊ False;

procedure TForm1.Query1Detail1GetText(Sender: TField; var Text: string;
DisplayText: Boolean);
begin
 // DBGrid ֪ʱҪҪʾõFalse -> ʾ
 // Ϳɱ TextOut ص
 DisplayText : = False;
end;
end;

   Delphi 3 ܼ.:ԱijֶεֵС0ʱΪΪ.
DBGrid.OnDrawColumnCell(...) :

begin
 if TableField.AsInteger < 0 then
   DBGrid.Canvas.Font.Color := clRed
 else
   DBGrid.Canvas.Font.Color := clBlack;
 DBGrid.DefaultDrawColumnCell(...);
end;

Field ָĸʽԾЧд. 

 

ʵսDelphiɫЧ

   Delphiеؼ(TDbGrid)ʾͱ༭ݿдʮҪãȻʹؼͬʱҲΪдݲ֣ۻҡؼԣ˷ĴأĴӸıɫýǶȣһֽ취

   Ϊؼ6Чʵַؼݼӵķԡ

1. ЧʵкżзֱԲͬɫʾڵС
file://DbGridDrawColumnCell¼бд´룺

Case DataCol Mod 2 = 0 of
True: DbGrid1.Canvas.Brush.Color:= clBlue; file://żɫ
False: DbGrid1.Canvas.Brush.Color:= clAqua; file://dzɫ
End;
DbGrid1.Canvas.Pen.Mode:=pmMask;
DbGrid1.DefaultDrawColumnCell (Rect
DataCol
Column
State);

2. ߣͬʱԺɫͻʾǰԪЧͻʾǰѡеֶΡ

file://޸Ϊ
Case DataCol Mod 2 = 0 of
True: DbGrid1.Canvas.Brush.Color:= clBlue; file://żɫ
False: DbGrid1.Canvas.Brush.Color:= clAqua; file://dzɫ
End;
If ((State = [gdSelected]) or (State=[gdSelectedgdFocused])) then
If Not DbGrid1.SelectedRows.CurrentRowSelected then
DbGrid1.Canvas.Brush.Color:=clRed; file://ǰѡеԪʾɫ
DbGrid1.Canvas.Pen.Mode:=pmMask;
DbGrid1.DefaultDrawColumnCell (Rect
DataCol
Column
State);

ַͻеʾЧ

3ԺɫͻʾǰѡеС
   DbGridؼOptionsеdgRowSelectΪ棬ColorΪclAqua(ɫ)
DbGridDrawColumnCell¼бд´룺

if ((State = [gdSelected]) or (State=[gdSelected gdFocused])) then
DbGrid1.Canvas.Brush.color:=clRed; file://ǰԺɫʾʹñdzɫ
DbGrid1.Canvas.pen.mode:=pmmask;
DbGrid1.DefaultDrawColumnCell (Rect
DataCol
Column
State);

4ͻԵİЧͻǰУֲͬУֶΣ

file://ͬ3޸Ϊ
if ((State = [gdSelected]) or (State=[gdSelectedgdFocused])) then
begin
Case DataCol Mod 2 = 0 of
True : DbGrid1.Canvas.Brush.color:=clRed; file://ǰѡеżʾɫ
False: DbGrid1.Canvas.Brush.color:=clblue; file://ǰѡеʾɫ
end;
DbGrid1.Canvas.pen.mode:=pmmask;
DbGrid1.DefaultDrawColumnCell (Rect
DataCol
Column
State);
end;

5ߣ ͬʱԺɫͻԵǰЧ

file://ͬ3޸Ϊ
Case Table1.RecNo mod 2 = 0 of file://ݼļ¼Žж
True : DbGrid1.Canvas.Brush.color:=clAqua; file://żdzɫʾ
False: DbGrid1.Canvas.Brush.color:=clblue; file://ɫʾ
end;
if ((State = [gdSelected]) or (State=[gdSelectedgdFocused])) then file://ѡúɫʾ
DbGrid1.Canvas.Brush.color:=clRed;
DbGrid1.Canvas.pen.mode:=pmMask;
DbGrid1.DefaultDrawColumnCell (Rect
DataCol
Column
State);

6˫Чмòͬɫ֣ͬʱѡЧֲͬС

file://ͬ3޸Ϊ
Case Table1.RecNo mod 2 = 0 of file://ݼļ¼Žж
True : DbGrid1.Canvas.Brush.color:=clAqua; file://żdzɫʾ
False: DbGrid1.Canvas.Brush.color:= clblue; file://ɫʾ
end;
If ((State = [gdSelected]) or (State=[gdSelectedgdFocused])) then
Case DataCol mod 2 = 0 of
True : DbGrid1.Canvas.Brush.color:=clRed; file://ǰѡеżúɫ
False: DbGrid1.Canvas.Brush.color:= clGreen; file://ǰѡеɫʾ
end;
DbGrid1.Canvas.pen.mode:=pmMask;
DbGrid1.DefaultDrawColumnCell (Rect
DataCol
Column
State);

   6ֱַؼкеɫʽã߿ԸԼҪЧóDelphi5вͨ

 

DBGridTitleԲѯ
ؼ:DBGrid  

   ʵֵDBGridTitleԲѯһͨó򣬲һһ飬粻SQLOrder by ...ΪSQLԭѾOrder by ...ҵһTitleʱҪĿԴ

procedure TFHkdata.SortQuery(Column:TColumn);
var
 SqlStr,myFieldName,TempStr: string;
 OrderPos: integer;
 SavedParams: TParams;
begin
 if not (Column.Field.FieldKind in [fkData,fkLookup]) then exit;
 if Column.Field.FieldKind =fkData then
   myFieldName := UpperCase(Column.Field.FieldName)
 else
   myFieldName := UpperCase(Column.Field.KeyFields);
 while Pos(myFieldName,';')<>0 do
 myFieldName := copy(myFieldName,1,Pos(myFieldName,';')-1)+ ',' + copy(myFieldName,Pos(myFieldName,';')+1,100);
 with TQuery(TDBGrid(Column.Grid).DataSource.DataSet) do
 begin
   SqlStr := UpperCase(Sql.Text);
   // if pos(myFieldName,SqlStr)=0 then exit;
   if ParamCount>0 then
   begin
     SavedParams := TParams.Create;
     SavedParams.Assign(Params);
   end;
   OrderPos := pos('ORDER',SqlStr);
   if (OrderPos=0) or (pos(myFieldName,copy(SqlStr,OrderPos,100))=0) then
     TempStr := ' Order By ' + myFieldName + ' Asc'
   else if pos('ASC',SqlStr)=0 then
     TempStr := ' Order By ' + myFieldName + ' Asc'
   else
     TempStr := ' Order By ' + myFieldName + ' Desc';
   if OrderPos<>0 then SqlStr := Copy(SqlStr,1,OrderPos-1);
   SqlStr := SqlStr + TempStr;
   Active := False;
   Sql.Clear;
   Sql.Text := SqlStr;
   if ParamCount>0 then
   begin
     Params.AssignValues(SavedParams);
     SavedParams.Free;
   end;
   Prepare;
   Open;
 end;
end;


ȥDbGridԶӹ

ؼ:DbGrid 

   ƶһ¼ʱٰһ¡¡ͻ׷һ¼ȥ
   procedure TForm1.DataSource1Change(Sender: TObject; Field: TField);
   begin
     if TDataSource(Sender).DataSet.Eof then TDataSource(Sender).DataSet.Cancel;
   end;


 

DBGrid֧ƶĽ(л wangxian11 ṩ)

Լ׽WM_MOUSEWHEELϢ
private
 OldGridWnd : TWndMethod;
procedure NewGridWnd (var Message : TMessage);
public

procedure TForm1.NewGridWnd(var Message: TMessage);
var
 IsNeg : Boolean;
begin
 if Message.Msg = WM_MOUSEWHEEL then
 begin
   IsNeg := Short(Message.WParamHi) < 0;
   if IsNeg then
     DBGrid1.DataSource.DataSet.MoveBy(1)
   else
     DBGrid1.DataSource.DataSet.MoveBy(-1)
 end
 else
   OldGridWnd(Message);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 OldGridWnd := DBGrid1.WindowProc ;
 DBGrid1.WindowProc := NewGridWnd;
end;     

 


hoplite :2005.01.11 18:43 ::: ( ) ::Ķ:(867) :: (1) :: (0)
===========================================================
windows API ShellExecuteĶ÷
===========================================================
windows API ShellExecuteĶ÷
USES SHELLAPI
   һվʱһWINDOWS APIѧϰϣϳѧ߸˽APIʹá
   ShellExecuteĹһⲿ򣨻ǴһעļһĿ¼ӡһļȵȣⲿһĿơ
мAPIʵЩܣڴShellExecuteǸıʹõģͬʱ̫ӡ˵÷
ʼһµӦó
ShellExecute(Handle, ''open'', PChar(''c:testapp.exe''), nil, nil, SW_SHOW);
򿪼±һļ(ϵͳʶ±Ӧó·Dzʹþ·
ShellExecute(Handle, ''open'', PChar(''notepad''), PChar(''c:testreadme.txt''), nil, SW_SHOW);
ӡһĵ
ShellExecute(Handle, ''print'', PChar(''c:testtest.doc''), nil, nil, SW_SHOW);
ע⣺ῴwordʱı򿪣Զرա
һHTMLҳ
ShellExecute(Handle, ''open'', PChar(''http://www.festra.com/''), nil, nil, SW_SHOW);
ͨһѾעļӦó
ShellExecute(Handle, ''open'', PChar(''c:testreadme.txt''), nil, nil, SW_SHOW);
windows Explorer һĿ¼
ShellExecute(Handle, ''explore'', PChar(''c:windows)'', nil, nil, SW_SHOW);
һDOS
ShellExecute(Handle, ''open'', PChar(''command.com''), PChar(''/c copy file1.txt file2.txt''), nil, SW_SHOW);
һDOSDOSڴ
ShellExecute(Handle, ''open'', PChar(''command.com''), PChar(''/k dir''), nil, SW_SHOW);
hoplite :2005.01.10 12:52 ::: ( ) ::Ķ:(354) :: (0) :: (0)
===========================================================
delphiΫ@ȡϵyϢ
===========================================================
еĴȥ߿ɸݳӸ
1ȡwindows汾Ϣ
ͨWindows APIGetVersionExá
£
Procedure Tform1.Button1Click(sender:TObject);
Var
OSVI:OSVERSIONINFO;
begin
OSVI.dwOSversioninfoSize:=Sizeof(OSVERSIONINFO)
GetVersionEx(OSVI);
label1.Caption:=IntToStr(OSVI.dwMinorVersion)+','
+IntToStr(OSVI.dwMinorVersion)+','
+IntToStr(OSVI.dwBuildNumber)+','
+IntToStr(OSVI.dwPlatformId)+','
+OSVI.szCSDVersion;
end;
 
end.
 
2ȡCPUϢ
ͨWindows APIGetSystemInfoйϢ
£
procedure TForm1.Button1Click(Sender: TObject);
Var
SysInfo:SYSTEM_INFO;
begin
GetSystemInfo(Sysinfo);
Edit1.Text:='ϵͳ'+IntToStr(Sysinfo.dwNumberOfProcessors)+'CPU'
+',Ϊ'+IntToStr(Sysinfo.dwProcessorType); 
end;
 
end.
 
3ȡڴϢ
ͨWindows APIGlobalMemoryStatusڴϢ
£
procedure TForm1.Button1Click(Sender: TObject);
Var
MemInfo:MEMORYSTATUS;
begin
MemInfo.dwLength:=sizeof(MEMORYSTATUS);
GlobalMemoryStatus(MemInfo);
memo1.Lines.Add(IntToStr(MemInfo.dwMemoryLoad)+'%ڴʹ') ;
memo1.Lines.Add('ڴ湲'+IntToStr(MemInfo.dwTotalPhys)+'ֽ');
memo1.Lines.Add('ʹõڴ'+IntToStr(MemInfo.dwAvailPhys)+'ֽ');
memo1.Lines.Add('ļܴСΪ'+IntToStr(MemInfo.dwTotalPageFile)+'ֽ') ;
memo1.Lines.Add('пɽļСΪ'+IntToStr(MemInfo.dwAvailPageFile)+'ֽ');
memo1.Lines.Add('ڴ'+IntToStr(MemInfo.dwTotalVirtual)+'ֽ');
memo1.Lines.Add('δڴ'+IntToStr(MemInfo.dwAvailVirtual)+'ֽ');
end;
 
end.
 
´룺
memo1.Text:=IntToStr(MemInfo.dwMemoryLoad)+'%ڴʹ'+#13#10
+'ʹõڴ'+IntToStr(MemInfo.dwAvailPhys)+'ֽ'+#13#10
+'ļܴСΪ'+IntToStr(MemInfo.dwTotalPageFile)+'ֽ'+#13#10
+'пɽļСΪ'+IntToStr(MemInfo.dwAvailPageFile)+'ֽ'+#13#10
+'ڴ'+IntToStr(MemInfo.dwTotalVirtual)+'ֽ'+#13#10
+'δڴ'+IntToStr(MemInfo.dwAvailVirtual)+'ֽ';
memo1.line.add()֡
 
4ȡWindowsϵͳ·
ͨWindows API
£
procedure TForm1.Button1Click(Sender: TObject);
Var
SysDir:array[0..128] of char;
begin
GetWindowsDirectory(SysDir,128);
Edit1.Text:='Windows ·'+SysDir;
GetSystemDirectory(SysDir,128);
Edit1.Text:=Edit1.Text+'; ϵͳ·'+SysDir;
end;
 
end.
Уͨеֵе128ɸΪԲС16ĵֵСڻ16쳣ߵIJϵͳΪWindows2000Ѳԡ
 
5ȡûעϢ
Ƕ֪һװУʾûҪϵкŻƷźûһЩעϢûĹ˾ơûȣԼװĿ¼·ȡ
ͨ´ɲ鿴ûעϢ
procedure TForm1.Button1Click(Sender: TObject);
Var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('SoftwareMicrosoftWindows NTCurrentVersion',False);
Edit1.Text:='ǰ·'+Reg.CurrentPath;
Edit2.Text:='Ʒϵкţ'+Reg.ReadString('ProductId');
Edit3.Text:='Ʒ'+Reg.ReadString('ProductName');
Edit4.Text:='עṫ˾ƣ'+Reg.ReadString('RegisteredOrganization');
Edit5.Text:='û'+Reg.ReadString('RegisteredOwner');
Edit6.Text:='ͣ'+Reg.ReadString('SoftwareType');
Reg.CloseKey;
Reg.Free;
end;
 
end.
ע⣺ڳ֮ǰUSESregistryԪ
 
6رWidows
ͨWindows APIExitWindowsExرWidows
procedure TForm1.Button1Click(Sender: TObject);
begin
if RadioButton1.Checked=true then
ExitWindowsEx(EWX_LOGOFF,0) //ûݵ¼
else if RadioButton2.Checked=true then
ExitWindowsEx(EWX_SHUTDOWN,1) //ȫػ
else if RadioButton3.Checked=true then
ExitWindowsEx(EWX_REBOOT,2) //
else if RadioButton4.Checked=true then
ExitWindowsEx(EWX_FORCE,4) //ǿйػ
else if RadioButton5.Checked=true then
ExitWindowsEx(EWX_POWEROFF,8); //رϵͳرյԴ
 
end;
 
end.

hoplite :2005.01.10 12:52 ::: ( ) ::Ķ:(401) :: (0) :: (0)
===========================================================
DelphiʹԴļ
===========================================================

DelphiʹԴļ 
ߣ˺ ʱ䣺2002.02.19 13:37:45
 
ԴҲݣ൱ϤֻݡӦóĿִдУǵ洢ģ䱻ʱڳִ˳DelphiеԴкܶͣڲͬĵط¼ࣺ

ͼԴһСλͼûòͬͼ治ͬӦó

ԴҲС͵λͼõɫࡣDelphiѾָһͼDzгõCursorԣͬʱûҲԶͼ

λͼԴDelphiֻǽλͼԴԴļУʹʱԴļе

ַԴִļ洢ԴļС

ͨʵ˵ԴDelphiе÷ʾDelphi 4еͨ

1Դļ

Delphiṩһͼα༭Image Editorͨñ༭Ա༭BitmapIconCursorԴļҲֱӻICOCURBMPļñ༭ִִܽںܡ༭ͼԴļʱImage EditorѡFile->New->Resource File ڵĴҼContentsٵIJ˵еNew ѡҪ༭ԴļͣBitmapIconCursor

2װʹԴļ

Դļ༭ɺļ׺Ϊ.resҪʹЩԴļҪͨӴڱļimplementationؼм룺

{$R *.DFM}
{$R Դļ.RES}


ԴļڵԪļаԴļҪWindowsAPIԴļݣ磺LoadIconLoadStringLoadBitmapLoadResourceȡ

磺װһΪmybmp.bmpļ

Bmp.Handle := LoadBitmap(Hinstance , 'mybmp.bmp');


ʾ˵ͼꡢλͼԴʹ÷ԴļTEST.RESж꣨cur1cur2λͼbmp1bmp2Լͼ꣨in1in2ڳжЩԴ˵áöʱʹλͼͼʾƶĸоƶLadel1ʱ㶨ĵһ״Button1ٰѹƵLadel1ʱ㶨ĵڶ״

unit testtes;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Image1: TImage;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
bmp12 : Integer;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{$R TEST.RES}
const
crMycur1 = 1;
crMycur2 = 2;
procedure TForm1.FormCreate(Sender: TObject);
var
bmp : TBitmap;
ico : TIcon;
begin
Screen.Cursors[crMycur1] := LoadCursor(Hinstance,'CUR1');
Screen.Cursors[crMycur2] := LoadCursor(Hinstance,'CUR2');
Label1.Cursor := crMycur1;
bmp := TBitmap.Create ;
bmp.Handle := LoadBitmap(Hinstance,'BMP1');
Image1.Width := bmp.Width + 10;
Image1.Height := bmp.Height + 10;
Image1.Canvas.Draw(4,8,bmp);
bmp12 := 1;
ico := TIcon.Create ;
ico.Handle := LoadIcon(Hinstance,'IN1');
Icon := ico;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Cursor := crMycur2;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
bmp:TBitmap;
ico : TIcon;
begin
bmp := TBitmap.Create ;
ico := TIcon.Create ;
if bmp12=1 then bmp12 := 2 else bmp12 :=1;
bmp.Handle := LoadBitmap(Hinstance,PChar('BMP'+IntToStr(bmp12)));
ico.Handle := LoadIcon(Hinstance,PChar('IN'+IntToStr(bmp12)));
Image1.Width := bmp.Width + 10;
Image1.Height := bmp.Height + 10;
Image1.Canvas.Draw(4,6,bmp);
Icon := ico;
end;
end.


3ַԴĶʹ

ַĴ洢ӦóǶģӦóֻʹԴʱ룬ʹ֮Ӷʡڴ棬ͬʱַҲڷ룬һЩַ༭ַһıļУʹDelphiеģFile->New->Text༭ַļַļĸʽ£

stringtable
begin
1,"book"
2,"apple"
3,"desk"
4,"pen"
5,"computer"
end


༭ַļѡSave asעҪļ͸ΪԴļ.RC⻹Դļ뾭ܳΪԴļ.RESΪDosʾµBRCC32·ΪD:Program FilesBorlandDelphi4Binbrcc32.exe ַԴļΪStrRes.rcDOSʾ룺brcc32 mydirStrRes.rc һΪStrRes.resԴļʹøļɷַԴʹü

unit teststr;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
count : integer;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{$R StrRes.RES}
const
wordcount = 5;
procedure TForm1.Button1Click(Sender: TObject);
var
strword : string;
begin
if count>wordcount then count := 1;
strword := LoadStr(count);
label1.Caption := strword;
count := count + 1;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
label1.Caption := LoadStr(1);
count := 2;
end;
end.


гwordcount¼ַԴļַcount¼ʾַšк󵥻Button1ťѭʾַԴļеÿһַ 

--------------------------------------------------------------

DelphiRESļ 
ߣӿ ʱ䣺2002.01.22 10:45:54
 
DelphiĿУͨһĿļͬ.RESļļڱӦóͼԴӦڴļĿļһбָʾ{$R *.res}߱ʱҪĿļͬ.RESļͬҪӦóԴʽκļͣҲ.RESļĽRESļDelphiڲļ

һ.RESļ
һƵļΪü±κı༭дļMyMusic.RCļĸʽ£
SRC1 FILE1 OnlyYou.mp3
SRC2 FILE2 YesterdayOnceMore.mp3
SRC3 FILE3 MoonRiver.mp3
 

УÿһбʾһԴÿһԴ壬һԴƣڶԴࣩļ֮ɿո
дɡMyMusic.RCļ󣬽.MP3ļͬһļУΪ˱·鷳ȻӦóbrcc32.exeλ..Delphi6Binbrcc32 mymusic.rcҪעǣֻзʽִСϵͳPATHвDelphi·ô㻹Ҫbrcc32.exeMyMusic.RC.MP3ļͬһ·нСк󣬽ͬһ·еõļMyMusic.RESһԴļʽѭWindows ׼ģ˿VBVCCBuilderȶֿʹá

ڳ.RESļ
ֻҪĿеijԪУҪЩԴĵԪʹӦóпɶԣ±ָʾ
$R MyMusic.RES}
{

ܸñָʾλڵԪκλãΪʹԴṹûǽ䲢λڱָʾ{$R *.dfm}ÿдļĵԪжибָʾıָʾȷ߱ڱӦóʱҪԴļMyMusic.RESӦóС

ʱȡԴ
ǻһDZҪģԴǸĿġĹ̽νӦóаԴļ»ԭ
procedure MusicResToFile(const ResName, ResType,FileName: string);
var
Res: TResourceStream;
begin
Res := TResourceStream.Create(HInstance,ResName, PChar(ResType));
Res.SaveToFile(FileName); //ԴΪļԭļ
//㻹ԽڴʵֶԴöΪļ
Res.Free;
end;
 

øù̵ʾ磺
MusicResToFile('SRC2', 'FILE2', 'TheSecondMusic.MP3');

ֵһǣô˷ȫԼİװ򣬸ðװһִļڸÿִļԴʽнҪװݣļ⣬ӦóҪⲿƵļ米֡ʾȣҲͨ˷ЩⲿļӦóУӶûɾЩƵļӦóIJ
 


DELPHIԴļijʹ 
ߣ ʱ䣺2003.01.23 09:30:21
 
ԴļĿе.resļDELPHI5project˵ResourcesԱ༭ԴҲʹVC.res ļб༭

עDelphiXDemosResxplorresxplor.exe ԽԴļЭʹԴļ

ͨ˵Դļʹ

ʹ()ԴļRT_RCDATA

procedure TForm1.TESTDATEClick(Sender: TObject);
var
  n: integer;
  hrscr1: HRSRC;
  hglobal1: HGLOBAL;
  str1: Pchar;
  p:pointer;
begin
//Դ  HInstance ʾʹ
//ͨ LoadLibrary('11.exe');ļ
 //RCDATA_1ѾDELPHIԴRCDATAĿڽ
  hrscr1:= FindResource(HInstance, 'RCDATA_1', RT_RCDATA);
  if  hrscr1=0 then exit;
//Դ
  hglobal1 := LoadResource(0, hrscr1);
  n := SizeofResource(Hinstance,hrscr1);
  ShowMessage('ݳΪ=' + inttostr(n));
//صΪһָ룬IJõıļ
//ʵпǶļָͨPԴNз
  str1 := LockResource(hglobal1);
  p:= LockResource(hglobal1);
  if str1 = nil then exit;
  ShowMessage(str1);
  showMessage('ַ:'+inttostr(length(str1)));
end;
 


ͼļ

procedure TForm1.iconBoxChange(Sender: TObject);
begin
Image1.Picture.Icon.Handle:=LoadIcon(HInstance,pchar(iconBox.Text));
end;
 


ıָ

procedure TForm1.currorboxChange(Sender: TObject);
begin
  Screen.Cursors[1] := LoadCursor(HInstance,pchar(currorbox.text));
  form1.Cursor:=1;
end;
 


BitmapͼƬ

procedure TForm1.LISTBITMAPChange(Sender: TObject);
begin
//  Image1
Image1.Picture.Bitmap.Handle:=LoadBitmap(HInstance,pchar(LISTBITMAP.text));
end;
 


EXTDLLļеԴ

procedure TForm1.useloadlibrayClick(Sender: TObject);
var
n:integer;
begin
n:=LoadLibrary('11.exe');
Image1.Picture.Bitmap.Handle:=LoadBitmap(n,pchar(LISTBITMAP.text));
FreeLibrary(n);
end;
 


ԡ1994꿪ʼһݿԱԱһҹ˾Ŀͨddxxkk@21cn.comϵ 


hoplite :2005.01.10 12:17 ::: ( ) ::Ķ:(729) :: (0) :: (0)