Jump to content

.NET Common Language Runtime (CLR) Framework


Recommended Posts

Here is a more Advanced example using the  Ribbon .NET Assembly using  CLR Library

Features :
• Easy to use (WYSIWYG)
• Compatible with .net 2.0 and above
• Easy to integrate in an application
• Support different layout Themes : Office 2007 / 2010 / 2013
 

Documentation :

New Site : https://github.com/RibbonWinForms/RibbonWinForms

Old Site : https://www.codeproject.com/Articles/364272/Easily-Add-a-Ribbon-into-a-WinForms-Application-Cs?fid=1704255&df=90&mpp=25&sort=Position&view=Normal&spc=Relaxed&fr=101&prof=True

Movie : shows how to use it in VS using C#

 

Result :

image-3.png

 image-4.png

CLR using the PS Automation Assembly :

#AutoIt3Wrapper_UseX64=y

#include "CLR.Au3"
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

Local $str = "Q0xTCiMgaHR0cHM6Ly9naXRodWIuY29tL1JpYmJvbldpbkZvcm1zL1JpYmJvbldpbkZvcm1zCiMgc2VlIGhlcmUgZm9yIHRpcHMgCiMgaHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1PUHJqN2MxQ1lJZwoKJFJ1bnNwYWNlID0gW3J1bnNwYWNlZmFjdG9yeV06OkNyZWF0ZVJ1bnNwYWNlKCkKCiRSdW5zcGFjZS5BcGFydG1lbnRTdGF0ZSA9ICJTVEEiICMgQ2hhbmdlIGhlcmUgIQokUnVuc3BhY2UuVGhyZWFkT3B0aW9ucyA9ICJSZXVzZVRocmVhZCIKCiRQb3dlclNoZWxsID0gW3Bvd2Vyc2hlbGxdOjpDcmVhdGUoKQoKJFBvd2VyU2hlbGwuUnVuc3BhY2UgPSAkUnVuc3BhY2UKCiRSdW5zcGFjZS5PcGVuKCkKCiRob3N0LlJ1bnNwYWNlLlRocmVhZE9wdGlvbnMudmFsdWVfXwokUnVuc3BhY2UuUnVuc3BhY2VTdGF0ZUluZm8KCiMgU3RhcnQgCiRzdHJpbmcgPSB7IAoKQWRkLVR5cGUgLVBhdGggKCIkUFdEXFN5c3RlbS5XaW5kb3d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EltYWdlID0gW1N5c3RlbS5EcmF3aW5nLkltYWdlXTo6RnJvbUZpbGUoIiRQV0RcU2F2ZUl0ZW0ucG5nIikgCiMgKChTeXN0ZW0uRHJhd2luZy5JbWFnZSkocmVzb3VyY2VzLkdldE9iamVjdCgicmliYm9uQnV0dG9uMS5TbWFsbEltYWdlIikpKTsKJEJ1dHRvbjEuVGV4dCA9ICJyaWJib25CdXR0b24xIjsKCiRCdXR0b24xLmFkZF9jbGljayh7CiAgICAkbWVzc2FnZWJveHJlcGx5ID0gW1N5c3RlbS5XaW5kb3dzLkZvcm1zLk1lc3NhZ2VCb3hdOjpTaG93KCJEbyB5b3Ugd2lzaCB0byBjb250aW51ZSA/IiwiV2VsY29tZSIsMykKfSkKCiMgcmliYm9uVGFiMgokVGFiMi5UZXh0ID0gInJpYmJvblRhYjIiOwoKJGZvcm0uQ29udHJvbHMuQWRkKCRyaWJib24pCgokZm9ybS5SZXN1bWVMYXlvdXQoJGZhbHNlKQoKJGZvcm0uU2hvd0RpYWxvZygpCn0KCiNFbmQKClt2b2lkXSRQb3dlclNoZWxsLkFkZFNjcmlwdCgkc3RyaW5nKQoKJFBvd2VyU2hlbGwuSW52b2tlKCkgCgokUG93ZXJTaGVsbC5FbmRJbnZva2UKCiRSdW5zcGFjZS5DbG9zZSgpCiRQb3dlcnNoZWxsLkRpc3Bvc2UoKQ=="
ConsoleWrite($str & @CRLF)

$str = _Base64Decode($str)

_Run_PSHost_Script(BinaryToString($str,1))


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)


; <<<<<<<<<<<<<<<<<<< PS COMMAND HERE >>>>>>>>>>>>>>>>>>>>
    $pObjectPS.AddScript($PSScript) ; Add Script here
;~  ConsoleWrite($PSScript & @CRLF)

    $objAsync = $pObjectPS.BeginInvoke ; (2); ($oActivatorType,$oActivatorType)

    While $objAsync.IsCompleted = False
;~          ConsoleWrite($objAsync.IsCompleted & @CRLF)
        ContinueLoop
    WEnd
        ConsoleWrite("Completed : " & $objAsync.IsCompleted & @CRLF)

    $objPsCollection = $pObjectPS.EndInvoke($objAsync)
;~  ConsoleWrite("$objPsCollection: " & IsObj($objPsCollection) & @TAB & "$objPsCollection: " & ObjName($objPsCollection) & " - " & ObjName($objPsCollection,6) & " - " & ObjName($objPsCollection,3) & @CRLF)

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://github.com/RibbonWinForms/RibbonWinForms/releases

Many thanks for the developer of the Ribbon .NET Assembly !

 

Enjoy !

ptrex

 

Link to post
Share on other sites
  • Replies 86
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

WHAT : is .NET Common Language Runtime (CLR) Framework The Common Language Runtime (CLR) is a an Execution Environment . Common Language Runtime (CLR)'s main tasks are to convert the .NET Managed

Hi All, Added a Quick Reference eBook .NET CLR Framework for AutoIT.pdf to post 1. Which is a summary of all technical articles headlines we posted before, In order to give everyone interest

Hello. I was needing to zip and unzip some folders. So I found an easy way using CLR. here a simple example.   #include ".\Includes\CLR.au3" #include ".\Includes\CLR Constants.au3"&

Here is an other more advanced Example that uses the SSRS Reporting .NET Assembly using  CLR Library

Features :

• Multiple Data Sources available
• Can run in REMOTE or LOCAL Mode
• Export possible to XLS(X) / DOC(X) / PDF

Result :

image-2.png

image-2.png

image-1.png

CLR using the PS Automation Assembly :

#AutoIt3Wrapper_UseX64=y

#include "..\CLR.Au3"
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>

Local $str = _Base64Decode("JFJ1bnNwYWNlID0gW3J1bnNwYWNlZmFjdG9yeV06OkNyZWF0ZVJ1bnNwYWNlKCkNCg0KJFJ1bnNwYWNlLkFwYXJ0bWVudFN0YXRlID0gIlNUQSIgIyBDaGFuZ2UgaGVyZSAhDQokUnVuc3BhY2UuVGhyZWFkT3B0aW9ucyA9ICJSZXVzZVRocmVhZCINCg0KJFBvd2VyU2hlbGwgPSBbcG93ZXJzaGVsbF06OkNyZWF0ZSgpDQoNCiRQb3dlclNoZWxsLnJ1bnNwYWNlID0gJFJ1bnNwYWNlDQoNCiRSdW5zcGFjZS5PcGVuKCkNCg0KJHN0cmluZyA9IHsgDQpBZGQtVHlwZSAtUGF0aCAiQzpcV0lORE9XU1xhc3NlbWJseVxHQUNfTVNJTFxNaWNyb3NvZnQuUmVwb3J0Vmlld2VyLldpbkZvcm1zXDEyLjAuMC4wX184OTg0NWRjZDgwOD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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gICAgICAgICAgICANCiNTaG93IGFzIERpYWxvZyBVc2luZyBXaW5kb3dzIEZvcm0gICAgICAgICAgICANCiMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAgICAgICAgICAgIA0KI2NyZWF0ZSBhIG5ldyBmb3JtICAgICAgICAgICAgDQokZm9ybSA9IE5ldy1PYmplY3QgV2luZG93cy5Gb3Jtcy5Gb3JtICAgICAgICAgICAgDQogICAgICAgICAgICAgDQojd2UncmUgZ29pbmcgdG8gbWFrZSBpdCBqdXN0IHNsaWdodGx5IGJpZ2dlciB0aGFuICAgICAgICAgICAgIA0KJGZvcm0uSGVpZ2h0ID0gODEwICAgICAgICAgICAgDQokZm9ybS5XaWR0aD0gMTIxMCAgICAgICAgICAgIA0KJGZvcm0uQ29udHJvbHMuQWRkKCRydikgICAgICAgICAgICANCiRydi5TaG93KCkgICAgICAgICAgICANCiRmb3JtLlNob3dEaWFsb2coKSAgICAgICAgICAgIA0KDQoNCiRzcWwuRGlzcG9zZSgpDQokY29uLkNsb3NlKCkNCn0NCg0KDQpbdm9pZF0kUG93ZXJTaGVsbC5BZGRTY3JpcHQoJHN0cmluZykNCg0KJFBvd2VyU2hlbGwuSW52b2tlKCkgDQo=")


_Run_PSHost_Script(BinaryToString($str,1))


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)


; <<<<<<<<<<<<<<<<<<< PS COMMAND HERE >>>>>>>>>>>>>>>>>>>>
    $pObjectPS.AddScript($PSScript) ; Add Script here
;~  ConsoleWrite($PSScript & @CRLF)

    $objAsync = $pObjectPS.BeginInvoke ; (2); ($oActivatorType,$oActivatorType)

    While $objAsync.IsCompleted = False
;~          ConsoleWrite($objAsync.IsCompleted & @CRLF)
        ContinueLoop
    WEnd
        ConsoleWrite("Completed : " & $objAsync.IsCompleted & @CRLF)

    $objPsCollection = $pObjectPS.EndInvoke($objAsync)
;~  ConsoleWrite("$objPsCollection: " & IsObj($objPsCollection) & @TAB & "$objPsCollection: " & ObjName($objPsCollection) & " - " & ObjName($objPsCollection,6) & " - " & ObjName($objPsCollection,3) & @CRLF)

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 :

SSRS Assembly here :

2008 / 2010 / 2012 or 2015 

Many thanks for the developer(s) of the SSRS .NET Assembly !

 

Enjoy !

ptrex

Link to post
Share on other sites
  • 2 months later...

I guess you didn't read that link that was posted to you earlier. is it on the list of things to do? most likely not. there are other UDFs that allow you to run .NET code as well as load DLLs

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to post
Share on other sites
  • 3 months later...

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Skeletor
      Hi All,
      So I was searching through the internet and found a plethora of information to learn C#. 
      However, some are way below par and does not explain very well. 

      So, anyone can suggest a proper website or eBook or video course explaining C#?
       
      I've learnt AutoIt (still I'm learning it) by making small programs, reading the forums, going through the F1 guide (huge help, seriously this helps alot) and reading the Wiki.
      Any direction would be appreciated, just not off the edge of a cliff.. 
    • By mLipok
      I have a project in mind that I would like to share.
      I would like to create example windows with standard elements like ComboBox, ListView, some Button, some text, some edit field.

      Nothing special just simple Window.Net form that can be created with this following UDF:
      or this one:
       
      The main idea is to easily provide possible modifications to the "Testing GUI Window", and no need for any other tool than the AutoIt + SciTE kit.

      Such "Testing GUI Window" will be very useful later on topic/threads/projects like:

      As I am not very familiar with NetFramework, I would like to ask for help with this project.
      Thanks in advance for any help.
      @mLipok
       
       
       
    • By buymeapc
      Hello,
      I was looking for a way to use the CLR functions to check a SQL 2016 database state, but I've been unable to find an example that I can get to work. Any help would be appreciated. Here's what I have, which always errors when I try to set the connection string and I'm not sure why. Thanks!
      #include ".\Includes\CLR.au3" #include ".\Includes\CLR Constants.au3" JustATest() Func JustATest() Local $oAssembly = _CLR_LoadLibrary("System.Data") ConsoleWrite("$oAssembly: " & IsObj($oAssembly) & @CRLF) Local $oSQLConn = _CLR_CreateObject($oAssembly, "System.Data.SqlClient.SqlConnection") ConsoleWrite("$oSQLConn: " & IsObj($oSQLConn) & @CRLF) $oSQLConn.ConnectionString = "Server=serverip;Database=dbname;UID=user;PWD=aaaa;" $oSQLConn.Open EndFunc Edit: I am using ptrex's CLR UDF from here:
    • By Earthshine
      This baby can do almost any language! I found Gleany on this site and set it up on a fresh win10 install. all i would need to do to make it build an exe of the search files app we discovered is the .NET Target Framework download to build 100 % but the exe works and generates! You also need to add the path the the version of csc.exe that you want to run. MSBuild is part of .NET and can read your .csproj file.
      YOU can develop .NET OR C/C++ on this baby!
      Super lightweight (fit for crappy laptops), and you can use any dev compilers you wish, Ming, MS, etc, whatever.
      To use the build, you need to open the csproj file, else, to check your syntax it can compile individual files as well. The warning are because I do not have the .NET 4.6 Targeting Pack installed... LOL, and I could get rid of the Core warning, yes, I did not want to build a .NET Core.dll I wanted a live x64 exe! Told you MSBUILD could handle .CSPROJ, .VBPROJ, and all others Microsoft. Don't let Visual Code or Visual Studio slow you down, although, this works with Visual Code as well but there is only debugging in CORE.DLL projects

      ListFiles Example.zip
       

    • By breakbadsp
      AutoIT AU3info doeas not detect all gui objects uniquely for .NET GUIs developed in C#.
      this is not working now i am using COM windows approach for this, But its very difficult.
      Please let me know if anyone has done it before.
×
×
  • Create New...