Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 12:17

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Textdatei mit AutoIT erstellen.

Discussion on Textdatei mit AutoIT erstellen. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Yakuza™'s Avatar
 
elite*gold: 85
Join Date: Jan 2011
Posts: 1,526
Received Thanks: 1,060
Textdatei mit AutoIT erstellen.

Hallo zusammen,

ich habe ein Problem. Ich bin momentan dabei AutoIT zu lernen und habe jetzt mal zur Übung ein kleines Programm erstellt mit dem ich Textdateien erstellen kann.

Ich würde gerne in der Inputbox am Anfang einen Random Namen eingeben unter dem die Datei gespeichert wird. Jetzt hab ich nur keine Ahnung wie ich das anstellen soll. Habe es mit einer Variablen versucht aber das klappt so nicht.

Ich hoffe es kann mir jemand helfen.

Code:
HotKeySet("{F7}", "Ende")
Func Ende ()
   Exit
   EndFunc

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Texteditor", 334, 442, 384, 142)
GUISetBkColor(0xFFFFFF)
$Pic1 = GUICtrlCreatePic("F:\AutoIT Projekte\Texteditor\Bilder\notepad-logo.jpg", 24, 8, 289, 193)
$Edit = GUICtrlCreateEdit("", 24, 216, 289, 153)
$Button1 = GUICtrlCreateButton("Speichern", 88, 384, 161, 49)
$Auswahl = InputBox("Dateiname", "Gebe einen Namen ein")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		 Case $Button1
			$Box = GUICtrlRead($Edit)
			FileWrite($Auswahl.txt, $Box)
	EndSwitch
WEnd
Yakuza™ is offline  
Old 12/10/2012, 15:49   #2

 
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 854
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>

HotKeySet("{F7}""Ende")

#Region ### START Koda GUI section ### Form=
$Form2 GUICreate("Texteditor"334442384142)
GUISetBkColor(0xFFFFFF)
$Pic1 GUICtrlCreatePic("F:\AutoIT Projekte\Texteditor\Bilder\notepad-logo.jpg"248289193)
$Edit GUICtrlCreateEdit(""24216289153)
$Button1 GUICtrlCreateButton("Speichern"8838416149)
$Auswahl InputBox("Dateiname""Gebe einen Namen ein")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
         Case 
$Button1
            $Box 
GUICtrlRead($Edit)
            
FileWrite($Auswahl ".txt"$Box)
    EndSwitch
WEnd

Func Ende 
()
   Exit
EndFunc 
Ich kapiere nicht ganz was du mit Random namen meinst.
PS: Wenn du z.b zwei Variablen schreibst musst du mit &(und) arbeiten.
BladeTiger12 is offline  
Thanks
1 User
Old 12/10/2012, 15:58   #3
 
Yakuza™'s Avatar
 
elite*gold: 85
Join Date: Jan 2011
Posts: 1,526
Received Thanks: 1,060
Quote:
Originally Posted by BladeTiger12 View Post
PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>

HotKeySet("{F7}""Ende")

#Region ### START Koda GUI section ### Form=
$Form2 GUICreate("Texteditor"334442384142)
GUISetBkColor(0xFFFFFF)
$Pic1 GUICtrlCreatePic("F:\AutoIT Projekte\Texteditor\Bilder\notepad-logo.jpg"248289193)
$Edit GUICtrlCreateEdit(""24216289153)
$Button1 GUICtrlCreateButton("Speichern"8838416149)
$Auswahl InputBox("Dateiname""Gebe einen Namen ein")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
         Case 
$Button1
            $Box 
GUICtrlRead($Edit)
            
FileWrite($Auswahl ".txt"$Box)
    EndSwitch
WEnd

Func Ende 
()
   Exit
EndFunc 
Ich kapiere nicht ganz was du mit Random namen meinst.
PS: Wenn du z.b zwei Variablen schreibst musst du mit &(und) arbeiten.
Ich danke dir jetzt funktioniert es so wie ich mir das vorgestellt habe. Lag wirklich nur an dem einem (&) zeichen.^^

PS: Mit Random Namen meinte ich das man einen beliebigen Namen eingeben kann unter dem die Datei gespeichert wird.
Yakuza™ is offline  
Old 12/10/2012, 16:14   #4

 
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 854
Das hast du doch mit der InputBox gemacht o.o?
BladeTiger12 is offline  
Reply




All times are GMT +1. The time now is 12:18.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.