gadzail Posted December 29, 2006 Share Posted December 29, 2006 I found this articlenet framework and vbscript (sorry, it is in italian).The meaning is that you can use some classes of the net framework in your script.So i tried to do something like that:Func F_test() $list=ObjCreate("System.Collections.sortedlist") $list.add("z","sappa") $list.add("f","asa") $list.add("a","dfdsappa") $list.add("h","qqwrtsappa") ConsoleWrite("test: "&$list.count&@crlf) for $i=0 to $list.count-1 ConsoleWrite($list.GetKey($i)&" - "&$list.Getbyindex($i)&@crlf) Next EndFuncIT works. It could be very helpful.Someone knows something about that?Someone knows other net classes we can use in scripting? mLipok 1 Link to comment Share on other sites More sharing options...
ptrex Posted December 29, 2006 Share Posted December 29, 2006 @gadzail I like this one. I am constantly looking for new objects myself, and this one I didn't have yet. Good job. Better next time is to post your examples in the EXAMPLE SCRIPT section of the forum. Ciao !! ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
gadzail Posted December 29, 2006 Author Share Posted December 29, 2006 @gadzailI like this one. I am constantly looking for new objects myself, and this one I didn't have yet.Good job.Better next time is to post your examples in the EXAMPLE SCRIPT section of the forum.Ciao !!ptrexOKS ptrex. You are right, It is better. I don't want to duplicate the post, maybe the admin can move it.I would like to know which net classes we can use in scripting.if someone find something please reply... Link to comment Share on other sites More sharing options...
ptrex Posted December 29, 2006 Share Posted December 29, 2006 this might give you a hint :COM System collections InterfaceEnjoy !!ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Gyatso Posted December 30, 2006 Share Posted December 30, 2006 here is your link to microsoft, but in the english versionhttp://www.microsoft.com/.../HeySc...ult.aspx?loc=en How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and back Link to comment Share on other sites More sharing options...
NELyon Posted December 30, 2006 Share Posted December 30, 2006 Hmm... This could prove Very useful. Nice find Link to comment Share on other sites More sharing options...
sohfeyr Posted December 31, 2006 Share Posted December 31, 2006 (edited) This is FANTASTIC!!! I wish I'd known about this a year ago!It looks like .Net members in registered DLLs with the COMVisible(True) attribute or an assigned GUID are available for scripting. This includes the following potentially useful items:System.Collections.ArrayListSystem.Collections.HashTableSystem.Collections.SortedListSystem.Collections.StackSystem.Collections.QueueSystem.Diagnostics.Debugger System.Diagnostics.StackFrameSystem.Diagnostics.StackTracevarious calendars and Info classes in System.GlobalizationSystem.IO.MemoryStreamSystem.IO.StringWriterSystem.Randoma LOT of things in System.Runtime.InteropServices and System.Runtime.RemotingSystem.Text.ASCIIEncodingSystem.Text.StringBuilderSystem.Text.UnicodeEncodingSystem.Threading.MutexSystem.Threading.OverLappedSystem.Threading.ReaderWriterLockI just did a bit of experimenting to see if SortedList would handle AutoIt-style arrays and DLLStruct variables. It turns out, Arrays work great, but DLLStructCreate seems to return something that can't be stored. One way around that is to use Assign() and Eval():expandcollapse popup#include <array.au3> $rect=DllStructCreate("int;int;int;int") ;~ MsgBox(0,"DLLStructCreate errorlevel", @error) DllStructSetData($rect,1,10) DllStructSetData($rect,2,20) DllStructSetData($rect,3,64) DllStructSetData($rect,4,48) ;~ MsgBox(0,$rect & "[ 3 ]", DllStructGetData($rect,3)) ; Assign the structure to a named variable. The DLLStruct can't be serialized effectively with this technique, but it can be dereferenced using Eval. Assign("rectstructure",$rect) $array=_ArrayCreate("1","2","3","4","a","b","c","d") $list=ObjCreate("System.Collections.SortedList") $list.add("z","sappa") $list.add("f","asa") $list.add("a","dfdsappa") $list.add("h","qqwrtsappa") $list.add("autoitarray",$array) $list.add("rectstruct","rectstructure") ConsoleWrite("test: " & $list.count & @crlf) for $i=0 to $list.count-1 $key=$list.GetKey($i) $value=$list.Getbyindex($i) If Not IsArray($value) Then ConsoleWrite($key & " - " & $value & @crlf) Else ConsoleWrite($key & " - ") For $j=0 to UBound($value)-1 ConsoleWrite($value[$j] & " ") Next ConsoleWrite(@crlf) EndIf Next ConsoleWrite("Rect structure with reference stored in sorted list:" & @CRLF) ConsoleWrite("x1: " & DllStructGetData(Eval($list("rectstruct")),1) & @CRLF) ConsoleWrite("y1: " & DllStructGetData(Eval($list("rectstruct")),2) & @CRLF) ConsoleWrite("x2: " & DllStructGetData(Eval($list("rectstruct")),3) & @CRLF) ConsoleWrite("y2: " & DllStructGetData(Eval($list("rectstruct")),4) & @CRLF)This outputs:test: 6 a - dfdsappa autoitarray - 1 2 3 4 a b c d f - asa h - qqwrtsappa rectstruct - rectstructure z - sappa Rect structure with reference stored in sorted list: x1: 10 y1: 20 x2: 64 y2: 48 +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 10.077(Yes, I know, the time on that is ridiculous - I think it is counting the compilation time from AU3Wrapper, though. A message box at the start of the script gives a reference point from which execution is almost instantaneous. Has anyone else noticed this?)I look forward to hearing others' experiences with this. This is an incredible discovery, gadzail! Edited December 31, 2006 by sohfeyr Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt Link to comment Share on other sites More sharing options...
nobbe Posted January 14, 2007 Share Posted January 14, 2007 hi this is awesome !! i like to have hashtables in auto it , now i can :-)) ; http://msdn2.microsoft.com/en-us/library/system.collections.hashtable.aspx $hash = ObjCreate("System.Collections.Hashtable") $hash.add ("txt", "notepad.exe") $hash.add ("bmp", "paint.exe") $hash.add ("dib", "paint.exe") $hash.add ("rtf", "wordpad.exe") ConsoleWrite("For key = 'bmp', value = " & $hash ("bmp") & @CRLF) ConsoleWrite("For key = 'rtf', value = " & $hash ("rtf") & @CRLF) Link to comment Share on other sites More sharing options...
vortexed Posted January 18, 2014 Share Posted January 18, 2014 Good find thanks guys! This is an example that don't think has been discussed before. I had a need to add items to a specific index within the collection and came up with this. http://msdn.microsoft.com/en-us/library/system.collections.arraylist.insert.aspx Global $Collection = ObjCreate("System.Collections.ArrayList") $Collection.Insert(0, "Hello") ConsoleWrite($Collection.Item(0) & @CRLF) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now