codesoft在delphi,C#中的例子
LabelView Sample:
private void Form1_Load(object sender, System.EventArgs e)
{
LabelApp=new LabelApplicationClass();
doc=(LabelView.LabelDocument)LabelApp.ActiveDocument();
doc.Open("c:workloglabel.lbl",true);
}
private void PrintLabel(string result)
{
try
{
LabelView.LabelField snLabel=(LabelView.LabelField)((LabelView.LabelFields)doc.LabelFields).Item("SN");
snLabel.Value=result;
doc.LabelSetup();
doc.PrintLabel(2,null,null,null,null,null,null);
}
catch(Exception err)
{
MessageBox.Show(err.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
LabelApp.Quit();
LabelApp = null;
System.GC.Collect();
}
Zebra-ZPL Sample:
先用Bar-One做成Barcode文件,再透過File-->Down formatter to print生成zpl文件,透過程式設計對zpl文件中特定資料進行替換,最後輸出到指定埠即可.
ofstream fout; //declare file-stream handle
fout.open("lpt1:", ios::out); //open out to lpt1:
fout< fout< fout< fout< fout< fout< fout< fout< fout< fout< fout< fout< fout< fout< fout< fout.close();
///////////////////////////////////////Codesoft Delphi
Var
BarApp,BarDoc:Variant;
Begin
BarApp := CreateOleObject('lppx.Application');
BarApp.Visible:=True;
BarDoc:=BarApp.ActiveDocument;
BarVars:=BarDoc.Variables;
BarDoc.Open('T018S1.Lab');
BarDoc.Variables.Item('Data1').Value:='ABCD';
BarDoc.Variables.Item('Data2').Value:='111';
BarDoc.Variables.Item('Data3').Value:='111ABCD';
Bardoc.Printlabel(1);
BarDoc.FormFeed;
Bardoc.Close;
BarApp.Quit;
End;
///////////////////////////////////////Codesoft C#
using LabelManager2;
ApplicationClass lbl = new ApplicationClass();
try
{
lbl.Documents.Open(@"D:TempTEMP.Lab", false);
Document doc = lbl.ActiveDocument;
//foreach(...)
//{
doc.Variables.FormVariables.Item("Var0").Value = "12399999";
//doc.Variables.FreeVariables
//doc.Variables.Formulas
//doc.Variables.TableLookups
//doc.Variables.DatabaseVariables
//doc.Variables.Dates
//doc.Variables.Counters
doc.PrintDocument(1);
//}
doc.Close(false);
}
catch (Exception ex)
{
lbl.Quit();
}
SAMPLE CODESOFT 8 APPLICATIONS
Click a link below to download a sample ActiveX application:
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/93029/viewspace-1027377/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- delphi加密C#解密(AES-256)加密C#解密
- Delphi在dbgrideh中新增Img顯示blobIDE
- Delphi 中禁止 FMX 框架的 TStringGrid 單元格被選中框架
- PHP中ZendCache用法的小例子PHP
- 從Delphi到Lazarus——Delphi轉換器
- delphi 裡的 列舉
- DFA在C#中的實現:過濾敏感詞C#
- async/await 在 C# 語言中是如何工作的?(中)AIC#
- delphi opencvOpenCV
- C# 在Word中插入公式(LaTeX/MathML)C#公式
- 在實際例子中學習正規表示式(高效率)
- C#操作Microsoft.Office.Interop.Word類庫完整例子C#ROS
- [C#]C#中字串的操作C#字串
- 在C#中進行單元測試C#
- mORMot 1.18 第08章 Delphi中的伺服器端JavaScriptORM伺服器JavaScript
- Delphi 論文閱讀 Delphi: A Cryptographic Inference Service for Neural Networks
- C# 左移右移在資料型別轉換中的使用C#資料型別
- 對稱加密演算法在C#中的踩坑日常加密演算法C#
- C#二維陣列在SLG中的實現和使用C#陣列
- 在Delphi中使用正規表示式校驗身份證號
- 在C#中如何監控其它應用全屏C#
- WPF/C#:在DataGrid中顯示選擇框C#
- Media Query 在 CSS 中使用的一個具體例子CSS
- Rxjs debounce 運算子在 SAP Spartacus 函式節流中的一個實際使用例子JS函式
- delphi xe 好用的日誌框架框架
- C#中的MVCC#MVC
- C#中的MVVMC#MVVM
- c#中的事件C#事件
- C#中的集合C#
- 關於SQL Server中儲存過程在C#中呼叫的簡單示例SQLServer儲存過程C#
- Delphi TDictionary字典類
- 小例子 理解 Laravel 中的 控制反轉模式Laravel模式
- 有關mysql中ROW_COUNT()的小例子MySql
- popmenu的例子
- [C#] [WPF] 在MVVM中實現拖拽功能 - 入門C#MVVM
- WPF/C#:在WPF中如何實現依賴注入C#依賴注入
- C# 在PDF文件中應用多種不同字型C#
- 簡單例子展示爬蟲在不同思想下的寫法單例爬蟲
- C#中Enum的用法C#