Hi,
du musst dir genau überlegen was du willst. Gucken ob bestimmte Wörter im Text enthalten sind, oder den Text zwischen zwei Wörtern oder oder oder.
Und dann solltest du die Datei mit FileRead auch einlesen sonst wird das nichts. ![]()
Mega
Hi,
du musst dir genau überlegen was du willst. Gucken ob bestimmte Wörter im Text enthalten sind, oder den Text zwischen zwei Wörtern oder oder oder.
Und dann solltest du die Datei mit FileRead auch einlesen sonst wird das nichts. ![]()
Mega
#include<GuiListView.au3>
#include<Array.au3>
#include<GUIConstantsEx.au3>
#include<ListViewConstants.au3>
GUICreate("NetView in ListView", 520, 550, 100, 100, -1)
GUISetBkColor(0x00E0FFFF) ; will change background color
$listview = GUICtrlCreateListView("Rechnername|Kommentar|IP", 10, 10, 400, 450, Default, $LVS_EX_GRIDLINES)
_GUICtrlListView_SetColumnWidth($listview, 2, $LVSCW_AUTOSIZE_USEHEADER)
Global $s_Comments[1], $n_IP[1]
Global $s_Servernames = Net_View()
For $i = 0 To UBound($s_Servernames) - 1
GUICtrlCreateListViewItem($s_Servernames[$i] & '|' & $s_Comments[$i] & '|' & $n_IP[$i], $listview)
Next
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit (0)
EndSwitch
WEnd
Func Net_View()
Local $s_Buf = ''
Local $a_Buf = ''
Local $i_Pid = Run(@ComSpec & ' /c net view', '', @SW_HIDE, 2 + 4)
While Not @error
$s_Buf &= StdoutRead($i_Pid)
If @error Then ExitLoop
WEnd
Local $netView_Lines = StringSplit($s_Buf, @LF)
ReDim $s_Comments[UBound($netView_Lines) ]
For $i = 4 To UBound($netView_Lines) - 1
$s_Comments[$i - 4] = StringMid($netView_Lines[$i], 24, 30)
Next
$a_Buf = StringRegExp($s_Buf, "\\\\([0-9a-zA-Z-]*)", 3)
ReDim $n_IP[UBound($a_Buf) ]
TCPStartup()
For $i = 1 TO UBound($a_Buf) -1
$n_IP[$i] = TCPNameToIP($a_Buf[$i])
Next
TCPShutdown ( )
ProcessClose($i_Pid)
Return $a_Buf
EndFunc ;==>Net_View
#include <Array.au3>
[/autoit] [autoit][/autoit] [autoit]Global Const $SV_TYPE_WORKSTATION = 0x1
Global Const $SV_TYPE_SERVER = 0x2
Global Const $SV_TYPE_SQLSERVER = 0x4
Global Const $SV_TYPE_DOMAIN_CTRL = 0x8
Global Const $SV_TYPE_DOMAIN_BAKCTRL = 0x10
Global Const $SV_TYPE_TIME_SOURCE = 0x20
Global Const $SV_TYPE_AFP = 0x40
Global Const $SV_TYPE_NOVELL = 0x80
Global Const $SV_TYPE_DOMAIN_MEMBER = 0x100
Global Const $SV_TYPE_PRINTQ_SERVER = 0x200
Global Const $SV_TYPE_DIALIN_SERVER = 0x400
Global Const $SV_TYPE_XENIX_SERVER = 0x800
Global Const $SV_TYPE_NT = 0x1000
Global Const $SV_TYPE_WFW = 0x2000
Global Const $SV_TYPE_SERVER_MFPN = 0x4000
Global Const $SV_TYPE_SERVER_NT = 0x8000
Global Const $SV_TYPE_POTENTIAL_BROWSER = 0x10000
Global Const $SV_TYPE_BACKUP_BROWSER = 0x20000
Global Const $SV_TYPE_MASTER_BROWSER = 0x40000
Global Const $SV_TYPE_DOMAIN_MASTER = 0x80000
Global Const $SV_TYPE_WINDOWS = 0x400000
Global Const $SV_TYPE_CLUSTER_NT = 0x1000000
Global Const $SV_TYPE_TERMINALSERVER = 0x2000000
Global Const $SV_TYPE_CLUSTER_VS_NT = 0x4000000
Global Const $SV_TYPE_LOCAL_LIST_ONLY = 0x40000000
Global Const $SV_TYPE_DOMAIN_ENUM = 0x80000000
Global Const $SV_TYPE_ALL = 0xFFFFFFFF
$aCompList = _NetServerEnum($SV_TYPE_WORKSTATION)
[/autoit] [autoit][/autoit] [autoit]_ArrayDisplay($aCompList)
[/autoit] [autoit][/autoit] [autoit]Func _NetServerEnum ($iSrvType = -1, $sDomain = '')
Local $uBufPtr = DllStructCreate("ptr;int;int"), $res[1]=[0], $i
Local $uRecord = DllStructCreate("dword;ptr"), $iRecLen = DllStructGetSize($uRecord)
Local $uString = DllStructCreate("char[16]")
Local $uDomain = DllStructCreate("byte[32]"), $pDomain = 0
If Not ($sDomain='' Or $sDomain='*') Then
DllStructSetData($uDomain, 1, StringToBinary($sDomain,2))
$pDomain = DllStructGetPtr($uDomain)
EndIf
Local $ret = DllCall ("netapi32.dll", "int", "NetServerEnum", _
"ptr", 0, "int", 100, _
"ptr", DllStructGetPtr($uBufPtr,1), "int", -1, _
"ptr", DllStructGetPtr($uBufPtr,2), _
"ptr", DllStructGetPtr($uBufPtr,3), _
"int", $iSrvType, "ptr", $pDomain, "int", 0 )
If $ret[0] Then Return SetError(1, $ret[0], '')
Local $res[DllStructGetData($uBufPtr,3)+1]=[DllStructGetData($uBufPtr,3)]
For $i=1 To DllStructGetData($uBufPtr,3)
Local $uRecord = DllStructCreate("dword;ptr", DllStructGetData($uBufPtr,1)+($i-1)*$iRecLen)
Local $sNBName = DllStructCreate("byte[32]", DllStructGetData($uRecord,2))
DllStructSetData($uString,1,BinaryToString(DllStructGetData($sNBName,1),2))
$res[$i] = DllStructGetData($uString,1)
Next
$ret = DllCall ("netapi32.dll", "int", "NetApiBufferFree", "ptr", DllStructGetData($uBufPtr,1))
Return $res
EndFunc
Mega
Hi,
guck mal bei FileOpen und FileRead
Mega
Wie soll denn dein Ablauf sein?
1)
2)
3)
Mega
Wenn du keine Schleife willst, dann darfst du auch keine schreiben.
$bla = InputBox( ....)
If $bla = ... Then
else
Exit(0)
Endif
Mega
Hi,
sowas gibt es schon kostenlos. Viele open source Projekte oder fertige Excel mit Makros.
Mega
Versuch es mal damit. Und wenn du ein Problem hast, dann poste bitte deinen Quellcode (ohne username + passwort)
+ die Fehlermeldung.
#include <INet.au3>
[/autoit] [autoit][/autoit] [autoit]$s_SmtpServer = "mail.gmx.net"
$s_FromName = "xxx"
$s_FromAddress = "xxx@gmx.de"
$s_ToAddress = "XXX"
$s_Subject = "My Test UDF"
$s_UName = "xxx@gmx.de"
$s_PWD = "xxx"
#cs
$arIniRead = IniReadSection(@ScriptDir & '\mails.ini', "mail")
$s_SmtpServer = $arIniRead[1][1]
$s_FromName = $arIniRead[2][1]
$s_FromAddress = $arIniRead[3][1]
$s_ToAddress = $arIniRead[4][1]
$s_Subject = $arIniRead[5][1]
$s_UName = $arIniRead[6][1]
$s_PWD = $arIniRead[7][1]
MsgBox(0, "", $s_SmtpServer & ' ' & $s_FromName & ' ' & $s_FromAddress & ' ' & $s_ToAddress & ' ' & $s_Subject & ' ' & $s_UName & ' ' & $s_PWD)
#ce
Dim $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
$Response = _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_UName, $s_PWD, $s_Subject, $as_Body)
;~ $Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
$err = @error
If $Response = 1 Then
MsgBox(0, "Success!", "Mail sent")
Else
MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf
;===============================================================================
;
; Function Name: _INetSmtpMailAuth()
; Description: Sends an email using SMTP over TCP IP.
; Parameter(s): $s_SmtpServer - SMTP server to be used for sending email
; $s_FromName - Name of sender
; $s_FromAddress - eMail address of sender
; $s_ToAddress - Address that email is to be sent to
; $s_Username - Username for Authentication (bernd670)
; $s_Passwd - Password for Authentication (bernd670)
; $s_Subject - Subject of eMail
; $as_Body - Single dimension array containing the body of eMail as strings
; $s_helo - Helo identifier (default @COMPUTERNAME) sometime needed by smtp server
; $s_first - send before Helo identifier (default @CRLF) sometime needed by smtp server
; $b_trace - trace on a splash window (default 0 = no trace)
; Requirement(s): None
; Return Value(s): On Success - Returns 1
; On Failure - 0 and sets
; @ERROR = 1 - Invalid Parameters
; @ERROR = 2 - Unable to start TCP
; @ERROR = 3 - Unable to resolve IP
; @ERROR = 4 - Unable to create socket
; @ERROR = 5x - Cannot open SMTP session
; @ERROR = 50x - Cannot send body
; @ERROR = 5000 - Cannot close SMTP session
; Authors: Original function to send email via TCP - Asimzameer
; Conversion to UDF - Walkabout
; Correction Helo, timeout, trace - Jpm
; Correction send before Helo - Jpm
; Include Authentication - bernd670
;
;===============================================================================
Func _INetSmtpMailAuth($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Username, $s_Passwd, $s_Subject = "", $as_Body = "", $s_helo = "", $s_first = "-1", $b_trace = 0)
Local $v_Socket
Local $s_IPAddress
Local $i_Count
Local $s_Send[9]
Local $s_ReplyCode[9];Return code from SMTP server indicating success
If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_Username = "" Or $s_Passwd = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then
SetError(1)
Return 0
EndIf
If $s_helo = "" Then $s_helo = @ComputerName
If TCPStartup() = 0 Then
SetError(2)
Return 0
EndIf
StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")
If @extended Then
$s_IPAddress = $s_SmtpServer
Else
$s_IPAddress = TCPNameToIP($s_SmtpServer)
EndIf
If $s_IPAddress = "" Then
TCPShutdown()
SetError(3)
Return 0
EndIf
$v_Socket = TCPConnect($s_IPAddress, 25)
If $v_Socket = -1 Then
TCPShutdown()
SetError(4)
Return (0)
EndIf
$s_Send[0] = "EHLO " & $s_helo & @CRLF
;~ If StringLeft($s_helo,5) <> "EHLO " Then $s_Send[0] = "EHLO " & $s_helo & @CRLF
$s_ReplyCode[0] = "250"
$s_Send[1] = "AUTH LOGIN" & @CRLF
$s_ReplyCode[1] = "334"
$s_Send[2] = _Base64Encoding($s_Username) & @CRLF
$s_ReplyCode[2] = "334"
$s_Send[3] = _Base64Encoding($s_Passwd) & @CRLF
$s_ReplyCode[3] = "235"
$s_Send[4] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF
$s_ReplyCode[4] = "250"
$s_Send[5] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF
$s_ReplyCode[5] = "250"
$s_Send[6] = "DATA" & @CRLF
$s_ReplyCode[6] = "354"
$s_Send[7] = "From: " & $s_FromName & " <" & $s_FromAddress & ">" & @CRLF & _
"To: " & "<" & $s_ToAddress & ">" & @CRLF & _
"Subject: " & $s_Subject & @CRLF & _
"Mime-Version: 1.0" & @CRLF & _
"Content-Type: text/plain; charset=US-ASCII" & @CRLF & _
@CRLF
$s_ReplyCode[7] = ""
$s_Send[8] = @CRLF & "." & @CRLF
$s_ReplyCode[8] = "250"
; open stmp session
If _SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
SetError(50)
Return 0
EndIf
; send header
For $i_Count = 0 To UBound($s_Send) - 2
If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
SetError(50 + $i_Count)
Return 0
EndIf
Next
; send body records (a record can be multiline : take care of a subline beginning with a dot should be ..)
For $i_Count = 0 To UBound($as_Body) - 1
; correct line beginning with a dot
If StringLeft($as_Body[$i_Count], 1) = "." Then $as_Body[$i_Count] = "." & $as_Body[$i_Count]
If _SmtpSend($v_Socket, $as_Body[$i_Count] & @CRLF, "", $b_trace) Then
SetError(500 + $i_Count)
Return 0
EndIf
Next
; close the smtp session
$i_Count = UBound($s_Send) - 1
If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
SetError(5000)
Return 0
EndIf
TCPCloseSocket($v_Socket)
TCPShutdown()
Return 1
EndFunc ;==>_INetSmtpMailAuth
;===============================================================================
;
; Function Name: _Base64Encoding()
; Description: Kodiert eine Zeichenfolge mit dem Base64-Verfahren
; (http://de.wikipedia.org/wiki/Base64)
; Parameter(s): $String - Zeichenfolge die kodiert werden soll
; Requirement(s): None
; Return Value(s): Kodierte Zeichenfolge
; Authors: bernd670
;
;===============================================================================
Func _Base64Encoding($String)
$strUmsetzung = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
$strRetValue = ""
For $i = 1 To StringLen($String) Step 3
$strTok = StringMid($String, $i, 3)
Switch StringLen($strTok)
Case 3
$iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
Asc(StringMid($strTok, 2, 1))) * 256 + _
Asc(StringMid($strTok, 3, 1))
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
$strRetValue &= $strTokCryt
Case 2
$iTokVal = (Asc(StringMid($strTok, 1, 1)) * 256 + _
Asc(StringMid($strTok, 2, 1))) * 256
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
$strRetValue &= $strTokCryt & "="
Case 1
$iTokVal = Asc(StringMid($strTok, 1, 1)) * 65536
$iTokVal = BitShift($iTokVal, 12)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1)
$iTokVal = BitShift($iTokVal, 6)
$strTokCryt = StringMid($strUmsetzung, (BitAND($iTokVal, 63)) + 1, 1) & $strTokCryt
$strRetValue &= $strTokCryt & "=="
EndSwitch
Next
Return $strRetValue
EndFunc ;==>_Base64Encoding
Mega
Heißt dein Skript zufällig metin2.exe? ![]()
Klar wieso nicht.
Zum Beispiel ToolWindow
Meinst du es liegt an Autoit? Schon mal dies probiert?
http://www.uvnc.com/install/installation.html
siehe unten /very silent
Mega
Ich denke, dass hat damit nichts zu tun. Wenn du die Maus nicht bewegst und anfängst zu tippen, wandert der Cursor in das Inputcontrol und ist somit weg. Wenn du anschließend wieder die Maus bewegst erscheint der Cursor wieder.
Aus meiner Sicht ist das Windows.
Mega
Sprich du pflegst eine Whitelist mit den erlaubten AutoitSkripten und alles andere wird zur einer Warnung?
Ich versuche deinen Ablauf und den dadurch entstehenden Mehrwert zu verstehen.
Einfach die Datei einlesen und mit StringInStr durchsuchen. Oder mit StringRegExp.
Hi,
wie soll der dein Ablauf sein?
1) alle exe Dateien untersuchen und feststellen ob es ein AutoitSkript ist. (sollte klappen)
Man muss daran denken, dass unter Windows das Skript auch hugo.autoit heißen kann und trotzdem ausgeführt werden kann. auch ohne .exe.
2) Du hast nun die Liste aller Dateien die Autoit Quellcode enthalten. Und nun?
Mega
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('GUIOnEventMode', 1)
[/autoit] [autoit][/autoit] [autoit]GUICreate("satinez-GUI", 300, 200, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, '_End')
$Input1 = GUICtrlCreateInput("", 70, 72, 169, 21)
$Input2 = GUICtrlCreateInput("", 70, 104, 169, 21)
$btn = GUICtrlCreateButton("OK", 110, 140, 100, 30)
GUICtrlSetState($btn, $GUI_DISABLE)
GUISetState(@SW_SHOW)
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
[/autoit] [autoit][/autoit] [autoit]Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func _end()
Exit (0)
EndFunc ;==>_end
Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam)
Local $controlID = _WinAPI_LoWord($wParam)
If $controlID = $Input1 Or $controlID = $Input2 Then
If StringLen(GUICtrlRead($Input1)) > 0 And StringLen(GUICtrlRead($Input2)) > 0 Then
GUICtrlSetState($btn, $GUI_ENABLE)
Else
GUICtrlSetState($btn, $GUI_DISABLE)
EndIf
; hier jegliche Logik rein.
EndIf
EndFunc ;==>MY_WM_COMMAND
Mega
Hi,
was soll damit passieren?
Wenn du z.B. Fehler oder sowas suchst, dann kannst du z.B. die Datei einfach in Excel öffnen und mit bedingter Formatierung sagen, wenn enthält ... dann Hintergrund rot.
Mega
Hallo,
es ist eine UDF und keine buildin function. Ihr könnt euch den Code also anschauen.
Mega