D1时有个dwin库,可以操作iE,请问D2现用什么操作iE啊?
ilovetopview
2012-02-23
D1时有个dwin库,可以操作iE,请问D2现用什么操作iE啊?
|
|
betty_betty2008
2012-02-23
Juno,juno 的com
|
|
ilovetopview
2012-02-23
原来有dwin下边的代码可用
module adr; import dwin.sys.win32.ie.IE; void main(char[][] args) { auto ie = ieCreate(null, "Width",800, "Height",600, "ToolBar",true, "MenuBar",true, "Navigate", "http://114.255.93.220"); Sleep(500); auto result = getElementsByName(ie, "btnG"); result[0].click(); } 但juno的com怎么用啊? |
|
betty_betty2008
2012-02-23
module junoautod2; import juno.base.native; import juno.com.core; import std.stdio; import std.string; import std.conv; extern(Windows) alias DllImport!("user32.dll","MessageBoxW",int function(uint handle,in wchar* msg,in wchar* caption,int style))MessageBox; void testIE() { auto ieApp=coCreate!(IDispatch)("InternetExplorer.Application",ExecutionContext.LocalServer); setProperty(ieApp,"Visible","true"); invokeMethod(ieApp,"Navigate","http://www.amazon.com"); } void testWord() { IDispatch wordApp=coCreate!(IDispatch)("Word.Application",ExecutionContext.LocalServer); setProperty(wordApp,"Visible","true"); IDispatch documents=getProperty!(IDispatch)(wordApp,"Documents"); IDispatch doc=invokeMethod!(IDispatch)(documents,"Add"); /*IDispatch*/ doc=invokeMethod!(IDispatch)(documents,"Add"); invokeMethod!(IDispatch)(documents,"Add"); VARIANT count=getProperty(documents,"Count"); //writefln("There are %s documents",count); MessageBox(0,to!(wchar[])(format("总共 %s documents",count)).ptr, "info",0); } void testExcel() { IDispatch excelApp=coCreate!(IDispatch)("Excel.Application",ExecutionContext.LocalServer); setProperty(excelApp,"Visible",true); IDispatch workbooks=getProperty!(IDispatch)(excelApp,"Workbooks"); IDispatch newWorkbook=invokeMethod!(IDispatch)(workbooks,"Add"); IDispatch worksheet=getProperty!(IDispatch)(excelApp,"Worksheets",1); setProperty(worksheet,"Cells",5,3,"data"); //invokeMethod!(IDispatch)(workbooks,"SaveAs"); } void main() { testIE; testWord; testExcel; } |
|
ilovetopview
2012-02-23
你做得挺好啊。
学习了,谢了。 感觉比c#还好用啊。 |
相关讨论
相关资源推荐
- dwin:基于RT-Thread物联网操作系统的dwin串口屏幕快速开发库!
- d2dWin32Acrylic:用d2d绘制的一个简单的win32亚克力窗口。 开发环境:VS 2019
- dwin-library:使用带有GoogelBooksAPI的ReactJs的库
- DGUS组态软件如何把一个单独的DWIN_SET文件夹还原成可以打开的工程?
- DWIN_OS_Builder_V19.zip_DWIN_OS_Builder_V19_D软件_OS开发_dwin os_迪文触
- Dwin_Set:一个关于固化屏幕的程序
- STM32迪文串口屏.rar_DGUS_dgus dwin_dgus dwin stm32_迪文 DGUS
- DWIN_SET.rar_DWIN_DWIN 22config意义_DWIN屏_医疗_触摸
- 【渝粤教育】电大中专Windows操作系统_1作业 题库
- 【渝粤教育】电大中专Windows操作系统 (2)作业 题库