Jump to content

Çekilen Resimleri Ftp Adresine Gönderme


LifeSux
 Share

Recommended Posts

Arkadaşlar şu şekilde bir kod yazdım ama nedense çalışmadı(göndermedi resmi ftp adresine ) . Amacım resimlerin kullanıcı sadece radioboxu işaretlediğinde ftp adresine gönderilmesi.

[codebox]
#include <FTPEx.au3>

DirCreate(@DesktopDir & "\klasor\")

$FilePath = @DesktopDir & "\klasor\"
$FileName = 'resim'
$FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1)

If Not IsArray($FileList) Then
$FileName &= '1.jpg'
Else
$FileName &= $FileList[0] + 1 & '.jpg'
EndIf

_ScreenCapture_Capture($FilePath & "\" & $FileName)



$server = 'ftp.byethost7.com'

$username = 'xxx'

$pass = 'xxxxx'



$Open = _FTP_Open('MyFTP Control')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

_FTP_FilePut($Conn, @DesktopDir & "klasor\resim1.jpg", "/htdocs/resim1.jpg")

$Ftpc = _FTP_Close($Open)[/codebox]

yardım ederseniz sevinirim.

teşekkürler...

not: yukarıdaki koda yazmadım ama screencapture.au3 falan var kodumun içinde. Edited by LifeSux
Link to comment
Share on other sites

[codebox]
#include <File.au3>
#include <ScreenCapture.au3>

$FilePath = @DesktopDir
$FileName = 'resim'
$FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1)

If Not IsArray($FileList) Then
$FileName &= '1.jpg'
Else
$FileName &= $FileList[0] + 1 & '.jpg'
EndIf

_ScreenCapture_Capture($FilePath & "\" & $FileName)
[/codebox]

veya
[codebox]
#include <ScreenCapture.au3>

; Capture full screen
_ScreenCapture_Capture(@DesktopDir & "\GDIPlus_Image1.jpg")

; Capture region
_ScreenCapture_Capture(@DesktopDir & "\GDIPlus_Image2.jpg", 0, 0, 796, 596)
[/codebox]
Blue_life alıntı
[codebox]
#include <ScreenCapture.au3>

; Capture full screen
_ScreenCapture_Capture(@DesktopDir & "\" & @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & @MIN & "-" & @SEC & ".jpg")
[/codebox]

Link to comment
Share on other sites

_FTP_FilePut($Conn, @DesktopDir & "klasor\resim1.jpg", "/htdocs/resim1.jpg")

Kodundaki sorun şurası.

_FTP_FilePut($Conn, @DesktopDir & "\klasor\resim1.jpg", "/htdocs/resim1.jpg")

böyle olmalıydı.Çünkü @DesktopDir sonunda \ işaretiyle dönmez.Başka bir hata çıkarsa o da muhtemelen kullanıcı adı veya şifreden dolayı olur.

Link to comment
Share on other sites

yani sonuç olarak böyle ama başınada #include <ScreenCapture.au3> koyması gerekiyor değilmi üstad çünki Screen Capture fonksiyonunu kullanıyor
[codebox]
#include <ScreenCapture.au3>
#include <FTPEx.au3>

DirCreate(@DesktopDir & "\klasor\")

$FilePath = @DesktopDir & "\klasor\"
$FileName = 'resim'
$FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1)

If Not IsArray($FileList) Then
$FileName &= '1.jpg'
Else
$FileName &= $FileList[0] + 1 & '.jpg'
EndIf

_ScreenCapture_Capture($FilePath & "\" & $FileName)

$server = 'ftp.byethost7.com'

$username = 'xxx'

$pass = 'xxxxx'

$Open = _FTP_Open('MyFTP Control')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

_FTP_FilePut($Conn, @DesktopDir & "\klasor\resim1.jpg", "/htdocs/resim1.jpg")

$Ftpc = _FTP_Close($Open)
[/codebox]

Link to comment
Share on other sites

[quote]not: yukarıdaki koda yazmadım ama screencapture.au3 falan var kodumun içinde. [/quote]

Dediği için tekrar ekleme gereği duymadım.

Edit:Gerçi kodlara eklediği kastetmemiştir haklısın o satırı da koymalı.

Edited by MostWanted
Link to comment
Share on other sites

[quote name='MostWanted' date='17 November 2011 - 22:44 ' timestamp='1321562655' post='1113329']
_FTP_FilePut($Conn, @DesktopDir & "klasor\resim1.jpg", "/htdocs/resim1.jpg")

Kodundaki sorun şurası.

_FTP_FilePut($Conn, @DesktopDir & "\klasor\resim1.jpg", "/htdocs/resim1.jpg")

böyle olmalıydı.Çünkü @DesktopDir sonunda \ işaretiyle dönmez.Başka bir hata çıkarsa o da muhtemelen kullanıcı adı veya şifreden dolayı olur.
[/quote]

Çok Teşekkürler . Artık sorunsuzca upload oluyor geriye tek bir sorun kaldı. Ben bu ftp upload özelliğini checkboxa atamak istiyorum yani hotkeye basılınca fotoğraf çekilsin ve klasore kaydedilsin . checkbox işaretliyse, ftp ye gönderilsin. Bunu nasıl yapabilirim ?

Link to comment
Share on other sites

tam kod bu şekilde.
[code]#include <File.au3>
#include <ScreenCapture.au3>
#include <FTPEx.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("xxxxxxxxxxxxxxx", 530, 246, 192, 124)
GUISetFont(12, 400, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("xxxxxxxxxxxxxxxxx", 56, 8, 410, 33)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("xxxxxxxxxxxxxxxxxx ", 96, 48, 335, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("xxxxx", 8, 200, 121, 41, $WS_GROUP)
$Button2 = GUICtrlCreateButton("xxxxxxx ", 136, 200, 121, 41, $WS_GROUP)
$Button3 = GUICtrlCreateButton("xxxxxxxx", 264, 200, 121, 41, $WS_GROUP)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("xxxxxxx", 392, 200, 121, 41, $WS_GROUP)
$Checkbox1 = GUICtrlCreateCheckbox("Çektiklerim Admine Gönderilsin", 312, 96, 209, 65)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button5 = GUICtrlCreateButton("Fotoğrafı Çek / F9", 88, 96, 209, 65, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
msgbox (0,"x","xxxx")
Case $Button2
msgbox (0,"x","xxx")
Case $Button3
MsgBox(0,"xxx","xxxxx")
Case $Button4
msgbox (0,"xxxx","xxxx")


EndSwitch
WEnd


DirCreate(@DesktopDir & "\klasor\")

$FilePath = @DesktopDir & "\klasor\"
$FileName = 'resim'
$FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1)

If Not IsArray($FileList) Then
$FileName &= '1.jpg'
Else
$FileName &= $FileList[0] + 1 & '.jpg'
EndIf

_ScreenCapture_Capture($FilePath & "\" & $FileName)



$server = 'ftp.byethost7.com'

$username = 'xxxxx'

$pass = 'xxxx'



$Open = _FTP_Open('MyFTP Control')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

_FTP_FilePut($Conn, @DesktopDir & "\klasor\resim1.jpg", "/htdocs/resim1.jpg")

$Ftpc = _FTP_Close($Open)
[/code]
edit kodda hata varmış düzelttim.

Edited by LifeSux
Link to comment
Share on other sites

Tamam da sen bu kodları programın kapanışına eklemişsin.herhangi bir butona eklemen gerekmiyor muydu?Her neyse senin bileceğin iş,

if Guictrlread($Checkbox1) = 1 then
$server = 'ftp.byethost7.com'

$username = 'xxx'

$pass = 'xxxxx'



$Open = _FTP_Open('MyFTP Control')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

_FTP_FilePut($Conn, @DesktopDir & "klasor\resim1.jpg", "/htdocs/resim1.jpg")

$Ftpc = _FTP_Close($Open)
endif

if Guictrlread($Checkbox1) = 1 then

bu kodun anlamı eğer seçiliyse demek.

Edited by MostWanted
Link to comment
Share on other sites

[quote name='MostWanted' date='17 November 2011 - 23:36 ' timestamp='1321565808' post='1113354']
Tamam da sen bu kodları programın kapanışına eklemişsin.herhangi bir butona eklemen gerekmiyor muydu?Her neyse senin bileceğin iş,

if Guictrlread($Checkbox1) = 1 then
$server = 'ftp.byethost7.com'

$username = 'xxx'

$pass = 'xxxxx'



$Open = _FTP_Open('MyFTP Control')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

_FTP_FilePut($Conn, @DesktopDir & "klasor\resim1.jpg", "/htdocs/resim1.jpg")

$Ftpc = _FTP_Close($Open)
endif

if Guictrlread($Checkbox1) = 1 then

bu kodun anlamı eğer seçiliyse demek.
[/quote]

Teşekkürler. Şuan kendi bilgisayarımda değilim gecince deniycem. Birde ben kullanıcıya programın açılışında msgbox yada benzeri bir şey ile uyarı vermek istiyorum ama bunu bir daha gösterme gibi bir seçenek eklenebilir mi ona ?

Link to comment
Share on other sites

[codebox]$Form1 = GUICreate("Önemli Uyarı!", 409, 291)
$Label1 = GUICtrlCreateLabel("LÜTFEN OKUYUNUZ!", 80, 16, 245, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Arial")
GUICtrlSetColor(-1, 0xFF0000)
$Label2 = GUICtrlCreateLabel("Programın içinde hiç bir zararlı yazılım bulunmamaktadır.Fakat bazı uyuz ", 24, 56, 339, 17)
$Label3 = GUICtrlCreateLabel("antivirüsler blacklist dosyasını çözmek için kullandığım programı virüs olarak ", 24, 72, 358, 17)
$Label4 = GUICtrlCreateLabel("görebilmektedir.Bazı antivirüslerde program internete bağlanıp keyleri indirdiği", 24, 88, 362, 17)
$Label5 = GUICtrlCreateLabel("için virüs olarak görebilmektedir.Programın içinde hiç bir zararlı yazılım yoktur.", 24, 104, 361, 17)
$Label6 = GUICtrlCreateLabel("Fakat böyle sorunlar oluşabiliyor.Şimdi eğer programın içine virüs koyduğumu", 24, 120, 362, 17)
$Label7 = GUICtrlCreateLabel('düşünüyorsan program henüz çalışmadan aşağıdaki "Çıkış" butonuna bas ve', 24, 136, 365, 17)
$Label8 = GUICtrlCreateLabel("çık.Yok ben sana güveniyorum programı kullanmak istiyorum diyosan", 24, 152, 326, 17)
$Label9 = GUICtrlCreateLabel('"Kabul Ediyorum ve Gir" butonuna bas.Unutmayın sizin özel bilgileriniz benim', 24, 168, 362, 17)
$Label10 = GUICtrlCreateLabel("umrumda değil.Sorun yaşamamak dileğiyle..", 24, 184, 208, 17)
$Label11 = GUICtrlCreateLabel("Not:Program çalışmadan önce Kaspersky'i kapatınız.Bilgisayarınızın 55-88.com'a", 24, 208, 378, 17)
$Label12 = GUICtrlCreateLabel("erişebildiğinden emin olun.", 24, 224, 127, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Bunu bir daha gösterme!", 24, 250, 137, 17)
$Button1 = GUICtrlCreateButton("Kabul Ediyorum ve Gir", 176, 248, 121, 25)
$Button2 = GUICtrlCreateButton("Çıkış", 312, 248, 75, 25)
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\tnctr-kaspersky", "notification") <> "no" Then GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\tnctr-kaspersky", "notification") = "no" Then ExitLoop
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
Exit
Case $Button1
If GUICtrlRead($Checkbox1) = $GUI_CHECKED then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\tnctr-kaspersky", "notification", "REG_SZ", "no")
GUIDelete($Form1)
ExitLoop
EndSwitch
WEnd[/codebox]

Ben kaspersky anahtarlıkta böyle bir yol gütmüştüm.Gördüğün gibi bi rege kaydediyordum eğer işaretlenirse regedite kaydettiriyordum.

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...