Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/17/2019 in all areas

  1. Hi All, It's been a while since someone posted something in the .NET CLR post ... Here is an example that loads a fully functional Report Designer .NET Assembly using CLR Library Features : • Easy to use (WYSIWYG) • Compartible with .net 2.0 and above • Easy to integrate in an application • Supports most DBMS (SQL server, SQL Express, MYSQL, MS Access & ODBC) • Simple expressions • Grouping and sorting • 1D Barcodes (Code 39, 128 and EAN 13), QR (requires qr library) Result : CLR using the PS Automation Assembly : #AutoIt3Wrapper_UseX64=n #include "CLR.Au3" $str = _Base64Decode("JFJ1bnNwYWNlID0gW3J1bnNwYWNlZmFjdG9yeV06OkNyZWF0ZVJ1bnNwYWNlKCkNCg0KJFJ1bnNwYWNlLkFwYXJ0bWVudFN0YXRlID0gIlNUQSIgIyBDaGFuZ2UgaGVyZSAhDQokUnVuc3BhY2UuVGhyZWFkT3B0aW9ucyA9ICJSZXVzZVRocmVhZCINCiRob3N0LlJ1bnNwYWNlLlRocmVhZE9wdGlvbnMudmFsdWVfXw0KJFJ1bnNwYWNlLlJ1bnNwYWNlU3RhdGVJbmZvDQoNCiRQb3dlclNoZWxsID0gW3Bvd2Vyc2hlbGxdOjpDcmVhdGUoKQ0KDQokUG93ZXJTaGVsbC5ydW5zcGFjZSA9ICRSdW5zcGFjZQ0KDQokUnVuc3BhY2UuT3BlbigpDQoNCiRzdHJpbmcgPSB7IA0KQWRkLVR5cGUgLUFzc2VtYmx5TmFtZSBTeXN0ZW0uV2luZG93cy5Gb3Jtcw0KQWRkLVR5cGUgLVBhdGggIkM6XF9cQXBwc1xfUG93ZXJTaGVsbFxfR1VJIEZvcm1zXC5ORVQgUmVwb3J0IEJ1aWxkZXJcUmVwb3J0RGVzaWduZXI1LjEuMC43LmRsbCINCkFkZC1UeXBlIC1QYXRoICJDOlxfXEFwcHNcX1Bvd2VyU2hlbGxcX0dVSSBGb3Jtc1wuTkVUIFJlcG9ydCBCdWlsZGVyXFFSQ29kZXIuZGxsIg0KQWRkLVR5cGUgLVBhdGggIkM6XF9cQXBwc1xfUG93ZXJTaGVsbFxfR1VJIEZvcm1zXC5ORVQgUmVwb3J0IEJ1aWxkZXJcU3lzdGVtLkRhdGEuU1FMaXRlLmRsbCINCkFkZC1UeXBlIC1QYXRoICJDOlxfXEFwcHNcX1Bvd2VyU2hlbGxcX0dVSSBGb3Jtc1wuTkVUIFJlcG9ydCBCdWlsZGVyXE15U3FsLkRhdGEuZGxsIg0KDQokcmQgPSBOZXctT2JqZWN0IFJlcG9ydERlc2lnbmVyNS5EZXNpZ25lcg0KDQokcmQuUHJvZHVjdFZlcnNpb24NCg0KJHJkID0gTmV3LU9iamVjdCBSZXBvcnREZXNpZ25lcjUuRGVzaWduZXINCiRyZC5TaG93RGlhbG9nKCkNCiRyZC5TaG93UHJvcGVydHkoKQ0KJHJkLlNob3dSZXBvcnRUcmVlKCkNCn0NCg0KW3ZvaWRdJFBvd2VyU2hlbGwuQWRkU2NyaXB0KCRzdHJpbmcpDQoNCiRQb3dlclNoZWxsLkludm9rZSgpIA==") _Run_PSHost_Script(BinaryToString($str,1)) ; 1 = Ansi, 2 = UTF16 Little Endian Func _Run_PSHost_Script($PSScript) Local $oAssembly = _CLR_LoadLibrary("System.Management.Automation") ConsoleWrite("!$oAssembly: " & IsObj($oAssembly) & @CRLF) ; Create Object Local $pAssemblyType = 0 $oAssembly.GetType_2("System.Management.Automation.PowerShell", $pAssemblyType) ConsoleWrite("$pAssemblyType = " & Ptr($pAssemblyType) & @CRLF) Local $oActivatorType = ObjCreateInterface($pAssemblyType, $sIID_IType, $sTag_IType) ConsoleWrite("IsObj( $oAssemblyType ) = " & IsObj($oActivatorType) & @TAB & @CRLF) ; Create Object Local $pObjectPS = 0 $oActivatorType.InvokeMember_3("Create", 0x158, 0, 0, 0, $pObjectPS) ConsoleWrite("IsObject: " & IsObj($pObjectPS) & @TAB & "$pObject: " & ObjName($pObjectPS) & @CRLF) $pObjectPS.AddScript($PSScript) ; Add Script here $objAsync = $pObjectPS.BeginInvoke ; (2); ($oActivatorType,$oActivatorType) While $objAsync.IsCompleted = False ContinueLoop WEnd ConsoleWrite("Completed : " & $objAsync.IsCompleted & @CRLF) $objPsCollection = $pObjectPS.EndInvoke($objAsync) EndFunc Func _Base64Decode($input_string) Local $struct = DllStructCreate("int;int;int") Local $dwFlags = 1 ; Base64, no headers DllCall("Crypt32.dll", "int", "CryptStringToBinary", _ "str", $input_string, _ "int", StringLen($input_string), _ "int", $dwFlags, _ "ptr", 0, _ "ptr", DllStructGetPtr($struct, 1), _ "ptr", DllStructGetPtr($struct, 2), _ "ptr", DllStructGetPtr($struct, 3)) Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") DllCall("Crypt32.dll", "int", "CryptStringToBinary", _ "str", $input_string, _ "int", StringLen($input_string), _ "int", $dwFlags, _ "ptr", DllStructGetPtr($a), _ "ptr", DllStructGetPtr($struct, 1), _ "ptr", DllStructGetPtr($struct, 2), _ "ptr", DllStructGetPtr($struct, 3)) Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode Downloads : RB Assembly here : https://sourceforge.net/projects/report-builder/ Prequisites : Reference 2 additional Assemblies for this version : 1. QRCoder.dll version 1.3.5 2. SQLIte.dll version 1.0.109 Many thanks for the developer of the Report Builder .NET Assembly ! Enjoy! ptrex
    3 points
  2. faustf

    Declaring a blank array.

    insert code in tag please , and try to create dinamically array in help you can look redim, create blank array and redim dinamically , will be a solution?? try bye good luck
    1 point
  3. Yes, it caught me again tonight. While a VHS tape has been copied to the hard disk, after 3.5 hours (30 minutes before the end) Windows has automatically rebooted after an update. That although activity was present. Thanks Micro scrap. Now I've created this script so it never happens again. Maybe it will help you too. Thanks to @argumentum for this new version. ; Switch off AutoReboot after Windows update ; Author: Exit ( http://www.autoitscript.com/forum/user/45639-exit ) ; Windows Registry Editor Version 5.00 ; [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU] ; "NoAutoRebootWithLoggedOnUsers"=dword:00000001 #RequireAdmin ; otherwise error 1 Local Const $sRegkeyname = "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" Local Const $sRegValuename = "NoAutoRebootWithLoggedOnUsers" Local $iAutoReboot = RegRead($sRegkeyname, $sRegValuename) Switch @error Case 0 Case 1, 2, -1 $iAutoReboot = 0 Case Else Exit MsgBox(64 + 262144, Default, "Error " & @error & " reading registry.", 0) EndSwitch If $iAutoReboot = 1 Then MsgBox(64 + 262144, Default, $sRegValuename & " switch was already ON." & @LF & @LF & "No further action required.", 0) Else Local $rc = RegWrite($sRegkeyname, $sRegValuename, "REG_DWORD", 1) If @error Then Exit MsgBox(64 + 262144, Default, "Error " & @error & " writing registry." & @LF & @LF & "#RequireAdmin missing?", 0) MsgBox(64 + 262144, Default, "NoAutoRebootWithLoggedOnUsers switch set ON." & @LF & @LF & "No AutoReboot will occour while you are logged on.", 0) EndIf Previous code in Spoiler.
    1 point
  4. Wish I knew about this when I was using Windows... I am sure some will find this very useful My story is about the same, but it was a long game installation instead of copying. I had to wipe the existing install (because I was away and not sure if it was installed properly) and do it again, fun times.
    1 point
  5. Luigi

    pdu (gsm)

    Try this... Is not a 'pretty' script like Julia Roberts, but... But, the first result is functional. Please, return a feedback if it work, have a bug, etc... I think we have the same interests in this script. #include <Array.au3> $Word = "hellohello" ConsoleWrite(_Asc2PDU($Word) & @LF) Func _Asc2PDU($Data) ; Author: Detefon ; Convert a simple text to PDU Local $a[1], $b[1], $c[1] $Temp = StringToASCIIArray($Data) For $x = 0 To UBound($Temp) - 1 $Temp[$x] = _Dec2Bin($Temp[$x]) $q = $x - (8 * Int($x/8)) _ArrayAdd($a,StringMid($Temp[$x],1,7-$q)) _ArrayAdd($b,StringTrimLeft($Temp[$x],7-$q)) Next For $x = 0 To UBound($a) - 1 If $x <> UBound($a) - 1 Then $d = $b[$x + 1] & $a[$x] Else $d = $a[$x] EndIf If Not ($d == "") Then _ArrayAdd($c,_BinaryToHexString($d)) Next Return _ArrayToString($c,"",1) EndFunc ; http://www.dreamfabric.com/sms/hello.html ; http://www.ehow.com/how_7840569_convert-text-pdu.html Func _Dec2Bin($Data) ; Author: Detefon Local $a = 1, $bin = "" While $Data > 0.5 $a = Mod($Data,2) $Data = Int($Data/2) $bin = $a & $bin WEnd Return $bin EndFunc Func _Bin2Dec($Data) ; Author: Detefon Local $Len = StringSplit($Data,""), $Numero For $x = $Len[0] To 1 Step - 1 $Numero += (2 ^ (8-$x)) * $Len[$x] Next Return $Numero EndFunc Func _BinaryToHexString($BinaryValue) ; http://www.autoitscript.com/forum/topic/70507-converter-dec-hex-bin/page__view__findpost__p__516614 Local $test, $Result = '',$numbytes,$nb If StringRegExp($BinaryValue,'[0-1]') Then If $BinaryValue = '' Then SetError(-2) Return EndIf Local $bits = "0000|0001|0010|0011|0100|0101|0110|0111|1000|1001|1010|1011|1100|1101|1110|1111" $bits = stringsplit($bits,'|') $test = StringReplace($BinaryValue,'1','') $test = StringReplace($test,'0','') If $test <> '' Then SetError(-1) Return EndIf While 1 $nb = Mod(StringLen($BinaryValue),4) If $nb = 0 Then ExitLoop $BinaryValue = '0' & $BinaryValue WEnd $numbytes = Int(StringLen($BinaryValue)/4) Local $bytes[$numbytes],$Deci[$numbytes] For $j = 0 To $numbytes - 1 $bytes[$j] = StringMid($BinaryValue,1+4*$j,4) For $k = 0 To 15 If $bytes[$j] = $bits[$k+1] Then $Deci[$j] = $k ExitLoop EndIf Next Next $Result = '' For $l = 0 To $numbytes - 1 $Result &= Hex($Deci[$l],1) Next Return $Result Else MsgBox(0,"Error","Wrong input, try again ...") Return EndIf EndFunc
    1 point
  6. Change line 2154 and you should be fine.
    0 points
×
×
  • Create New...