Jump to content

Using .NET from Autoit


Recommended Posts

I dont like .NET but since its here to stay i was wondering if it could be used to do something usefull.

After reading some articles on how to use .NET on vbs i came up with this little script

; http://msdn2.microsoft.com/en-us/library/system.collections.queue.aspx
$oCollection = ObjCreate("System.Collections.Queue")
If @error Then Exit -1

$oCollection.Enqueue("Task 1")
$oCollection.Enqueue("Task 2")
$oCollection.Enqueue("Task 3")

While $oCollection.Count > 0
    ConsoleWrite($oCollection.Dequeue & @LF)
WEnd

; http://msdn2.microsoft.com/en-us/library/system.random.aspx
$oRandom = ObjCreate("System.Random")
If @error Then Exit -2
ConsoleWrite("$oRandom.NextDouble() ->" & $oRandom.NextDouble() & @LF)
ConsoleWrite("$oRandom.Next() ->" & $oRandom.Next() & @LF)
is this 'thing' i used a .NET thing?

My old 'ProgID Browser' i used to use to lookup com stuff doesent work in this area.

does someone know tool to dig into this?

And why did i beleve Autoit doesent do .net calls until now?

or am i completely on the wrong track...

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

@piccaso

these are some links I found interesting experimenting with .Net and AU3

f_test()

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
EndFunc
oÝ÷ Ù«­¢+ØÀÌØí¡Í ô=©
ÉÑ ÅÕ½ÐíMåÍÑ´¹
½±±Ñ¥½¹Ì¹!͡ѱÅÕ½Ðì¤(ÀÌØí¡Í ¹ ÅÕ½ÐíÑáÐÅÕ½Ðì°ÅÕ½Ðí¹½ÑÁ¹áÅÕ½Ðì¤(ÀÌØí¡Í ¹ ÅÕ½ÐíµÀÅÕ½Ðì°ÅÕ½ÐíÁ¥¹Ð¹áÅÕ½Ðì¤(ÀÌØí¡Í ¹ ÅÕ½Ðí¥ÅÕ½Ðì°ÅÕ½ÐíÁ¥¹Ð¹áÅÕ½Ðì¤(ÀÌØí¡Í ¹ ÅÕ½ÐíÉÑÅÕ½Ðì°ÅÕ½ÐíݽÉÁ¹áÅÕ½Ðì¤()
½¹Í½±]É¥Ñ ÅÕ½Ðí½È­äôÌäíµÀÌäì°Ù±ÕôÅÕ½ÐìµÀìÀÌØí¡Í  ÅÕ½ÐíµÀÅÕ½Ð줵Àì
I1¤)
½¹Í½±]É¥Ñ ÅÕ½Ðí½È­äôÌäíÉÑÌäì°Ù±ÕôÅÕ½ÐìµÀìÀÌØí¡Í  ÅÕ½ÐíÉÑÅÕ½Ð줵Àì
I1

So far my 2 Cents

regards

ptrex

Edited by ptrex
Link to comment
Share on other sites

looks like this classes could be used:

$i = 1
While 1
    $sKey = "@" & RegEnumKey("HKEY_CLASSES_ROOT",$i)
    If @error Then ExitLoop
    If StringInStr($sKey,"@System.") Then 
        $sKey = StringTrimLeft($sKey,1)
        $oTest = ObjCreate($sKey)
        If Not @error Then
            If StringLen(ObjName($oTest)) > 0 Then ConsoleWrite($sKey & @LF)
        EndIf
    EndIf
    $i += 1
WEnd

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

looks like this classes could be used:

$i = 1
While 1
    $sKey = "@" & RegEnumKey("HKEY_CLASSES_ROOT",$i)
    If @error Then ExitLoop
    If StringInStr($sKey,"@System.") Then 
        $sKey = StringTrimLeft($sKey,1)
        $oTest = ObjCreate($sKey)
        If Not @error Then
            If StringLen(ObjName($oTest)) > 0 Then ConsoleWrite($sKey & @LF)
        EndIf
    EndIf
    $i += 1
WEnd
i also dont like .net but cool.
Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...