Jump to content

Input Ve Değişken,dosya Oluşturma


MertCanDinler
 Share

Recommended Posts

Bir Program Yapıyorum Guisini Çizdim Fakat Bir kaç Sorum Olacak
İnput1 e yazılan Url @daft117 arkadaşımızın bu konuda verdiği link kısaltma fonksiyonlarından Tinyurl olan yani alttaki koddan geçecek ve
input2 ye yazılacak ne yaptm ne ettm bunu beceremedm
TinyUrl Link Kısaltma Fonksiyonunu koymak isterdm ama indirmeniz lazm link gizlemeden dolayı bazı şeyler sorun çıkarıyor
Link http://www.tnctr.com/topic/191854-link-kysaltan-fonksiyonlar/
Kısaca input1 deki url Bu indirdiğniiz dosyadaki tinyurl fonksiyonundan geçecek ve input2 ye yazılacak---
---- Soru 2 ----
Ben Script Açıldığında ini uzantılı bir dosya oluşturmasını istiyorum fakat bunu oluşturacak kodu bulamadm :D

Çizdiğim Gui
[code]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1_1 = GUICreate("Link Kısaltıcı", 633, 360, 192, 124)
$Input1 = GUICtrlCreateInput("Input1", 112, 80, 321, 21)
$Input2 = GUICtrlCreateInput("Input2", 112, 104, 321, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Button1 = GUICtrlCreateButton("Kısalt", 440, 80, 73, 49, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Link", 72, 80, 37, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$List1 = GUICtrlCreateList("", 24, 152, 569, 188)
GUICtrlSetCursor (-1, 0)
$Radio1 = GUICtrlCreateRadio("TinyUrl", 224, 16, 65, 17)
$Radio2 = GUICtrlCreateRadio("is.gd", 296, 16, 65, 17)
$Label2 = GUICtrlCreateLabel("Tinyurl seçerseniz 'www.**Link gizleme siteleri güvenlik açısından engellenmiştir.**/...' gibi bir link alırsınız", 136, 40, 280, 17)
$Label3 = GUICtrlCreateLabel("is.gd yi seçerseniz 'www.is.gd/...' gibi bir link alırsınız", 136, 56, 253, 17)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Case $Input1
EndSwitch
WEnd
[/code]

Edited by MertCanDinler
Link to comment
Share on other sites

[codebox]#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=c:\documents and settings\mert can\desktop\guidesigner\forms\form1.kxf
$Form1_1 = GUICreate("Link Kısaltıcı", 633, 360, 192, 124)
$Input1 = GUICtrlCreateInput("www.google.com.tr", 112, 80, 321, 21)
$Input2 = GUICtrlCreateInput("", 112, 104, 321, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
$Button1 = GUICtrlCreateButton("Kısalt", 440, 80, 73, 49, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Link", 72, 80, 37, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$List1 = GUICtrlCreateList("", 24, 152, 569, 188)
GUICtrlSetCursor(-1, 0)
$Radio1 = GUICtrlCreateRadio("TinyUrl", 224, 16, 65, 17)
GUICtrlSetState(-1,1)
$Radio2 = GUICtrlCreateRadio("is.gd", 296, 16, 65, 17)
$Label2 = GUICtrlCreateLabel("Tinyurl seçerseniz 'www.**Link gizleme siteleri güvenlik açısından engellenmiştir.**/...' gibi bir link alırsınız", 136, 40, 280, 17)
$Label3 = GUICtrlCreateLabel("is.gd yi seçerseniz 'www.is.gd/...' gibi bir link alırsınız", 136, 56, 253, 17)

Local $GuiRead, $ConvertUrl
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$GuiRead = StringStripWS(GUICtrlRead($Input1), 3)
If StringInStr($GuiRead, ".") = 0 Or StringLen($GuiRead) < 3 Then ContinueCase

If GUICtrlRead($Radio1) <> 1 Then
$ConvertUrl = __isgd("www.google.com")
Else
$ConvertUrl = __TinyUrl("www.google.com")
EndIf
GUICtrlSetData($Input2, $ConvertUrl)
EndSwitch
WEnd

Func __TinyUrl($url)
If StringInStr($url, "http://", 2) = 0 Then $url = "http://" & $url
Return (BinaryToString(InetRead("http://**Link gizleme siteleri güvenlik açısından engellenmiştir.**/api-create.php?url=" & $url, 1)))
EndFunc ;==>__TinyUrl

Func __isgd($url)
If StringInStr($url, "http://", 2) = 0 Then $url = "http://" & $url
Return (BinaryToString(InetRead("http://is.gd/create.php?format=simple&url=" & $url, 1)))
EndFunc ;==>__isgd[/codebox]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...