muratboy31 Posted August 7, 2013 Share Posted August 7, 2013 Arkadaşlar merhaba, Öncelikle herkesin bayramı mübarek olsun... Ben network te bulunan bir klasöre resim dosyasını atıp bunu mysql veri tabanına yolunu yazmak istiyorum, acaba daha önce böyle bir işlem yapan beni yönlendirebilir mi ? Teşekürler Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 7, 2013 Editor Share Posted August 7, 2013 File.Copy("dosyayolu",\\\\networkdeki klasör); Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 7, 2013 Author Share Posted August 7, 2013 ama kullanıcı adı ve şifre var bağlanmak için guest giriş yapamıyor... Quote Link to comment Share on other sites More sharing options...
Dj Demir Posted August 7, 2013 Share Posted August 7, 2013 Kullanıcı adı ve şifre istemesi yani Guest hesabı girişi istemesinin sebebi; Senin o bilgisayardaki klasörün paylaştırılmamasından kaynaklanıyor. Klasörü paylaşıma aç girişe gerek kalmaz. Gerisi zaten File.Copy komutu. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 7, 2013 Author Share Posted August 7, 2013 öyle değil arkadaşım, bu kullandığım NAS/SAN cihaz, ben zaten bilerek kullanıcı adı ve şifresi veriyorum ki herkes girip kurcalamasın... Örnek; Ip adresi : 192.168.1.2 klasör : photo kullanıcı : admin şifre : 123456 \\192.168.1.2\photo yane... Quote Link to comment Share on other sites More sharing options...
Dj Demir Posted August 7, 2013 Share Posted August 7, 2013 Keşke baştan belirtsen :) Ams kendinden bağımsız olan inputa yazı aktarabiliyorsa eğer. Kullanıcı adını gireceğin inputun adı diyelim UserLogin O zaman Input.SetText("UserLogin", "admin") şeklinde olur. Ancak dediğim gibi Ams bunu destekliyor mu bilmiyorum. AutoIt destekliyordu. Bunu da denemek gerek. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 8, 2013 Author Share Posted August 8, 2013 Ams bu kadar mı zayıf bir dil ! Quote Link to comment Share on other sites More sharing options...
Dj Demir Posted August 8, 2013 Share Posted August 8, 2013 :) Yukarıda ne yazmışım Destekliyor mu bilmiyorum! Dene öğren bu kadar basit. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 8, 2013 Author Share Posted August 8, 2013 AMS 8 ile çalışan autoit plugin var mı acaba ? Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 8, 2013 Editor Share Posted August 8, 2013 (edited) Pluginler bölümünde var. Edit : http://www.tnctr.com/topic/216986-ams-iin-autoit/ Edited August 8, 2013 by pairs Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 9, 2013 Author Share Posted August 9, 2013 (edited) Tüm maplenmiş driveları nasıl listeleyebilirim acaba ? AutoIt.DriveMapGet("X:") sadece X değil de hepsini... Edited August 9, 2013 by muratboy31 Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 10, 2013 Editor Share Posted August 10, 2013 Drive Get Enumarable olması lazımdı öyle bir fonksiyonla tüm sürücüleri listeletip bir for döngüsünde Autoit.GetMap ile tek tek kontrol edersin. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 10, 2013 Editor Share Posted August 10, 2013 Yada bu kodlarla da listelete bilirsin. LuaCom pluginini aktif etmen lazım. function WMIDateStringToDate(dtmDate) if dtmDate then dtmDate = tostring(dtmDate); return (String.Mid (dtmDate, 7, 2) .. "/" .. String.Mid (dtmDate, 5, 2) .. "/" .. String.Left(dtmDate, 4) .. " " .. String.Mid (dtmDate, 9, 2) .. ":" .. String.Mid (dtmDate, 11, 2) .. ":" .. String.Mid (dtmDate, 13, 2) ); else return ""; end end function Escape(v) if (v == nil) then return ""; end if (type(v) == "table") then return Table.Concat(v, ", "); end if (type(v) == "boolean") then if (v == true) then return "Yes"; else return "No"; end end return v; end local sOutput = ""; local sOutputTitle = "Computer: localhost\r\n==========================================\r\n\r\n"; local oWMIService = luacom.GetObject("winmgmts:\\\\localhost\\root\\CIMV2"); local oColItems = oWMIService:ExecQuery("SELECT * FROM Win32_MappedLogicalDisk", "WQL", 48); if oColItems then local oEnum = luacom.GetEnumerator(oColItems); local oItem = oEnum:Next(); while oItem do sOutput = sOutput .. "Access: " .. Escape(oItem:Access()) .. "\r\n"; sOutput = sOutput .. "Availability: " .. Escape(oItem:Availability()) .. "\r\n"; sOutput = sOutput .. "BlockSize: " .. Escape(oItem:BlockSize()) .. "\r\n"; sOutput = sOutput .. "Caption: " .. Escape(oItem:Caption()) .. "\r\n"; sOutput = sOutput .. "Compressed: " .. Escape(oItem:Compressed()) .. "\r\n"; sOutput = sOutput .. "ConfigManagerErrorCode: " .. Escape(oItem:ConfigManagerErrorCode()) .. "\r\n"; sOutput = sOutput .. "ConfigManagerUserConfig: " .. Escape(oItem:ConfigManagerUserConfig()) .. "\r\n"; sOutput = sOutput .. "CreationClassName: " .. Escape(oItem:CreationClassName()) .. "\r\n"; sOutput = sOutput .. "Description: " .. Escape(oItem:Description()) .. "\r\n"; sOutput = sOutput .. "DeviceID: " .. Escape(oItem:DeviceID()) .. "\r\n"; sOutput = sOutput .. "ErrorCleared: " .. Escape(oItem:ErrorCleared()) .. "\r\n"; sOutput = sOutput .. "ErrorDescription: " .. Escape(oItem:ErrorDescription()) .. "\r\n"; sOutput = sOutput .. "ErrorMethodology: " .. Escape(oItem:ErrorMethodology()) .. "\r\n"; sOutput = sOutput .. "FileSystem: " .. Escape(oItem:FileSystem()) .. "\r\n"; sOutput = sOutput .. "FreeSpace: " .. Escape(oItem:FreeSpace()) .. "\r\n"; sOutput = sOutput .. "InstallDate: " .. WMIDateStringToDate(oItem:InstallDate()) .. "\r\n"; sOutput = sOutput .. "LastErrorCode: " .. Escape(oItem:LastErrorCode()) .. "\r\n"; sOutput = sOutput .. "MaximumComponentLength: " .. Escape(oItem:MaximumComponentLength()) .. "\r\n"; sOutput = sOutput .. "Name: " .. Escape(oItem:Name()) .. "\r\n"; sOutput = sOutput .. "NumberOfBlocks: " .. Escape(oItem:NumberOfBlocks()) .. "\r\n"; sOutput = sOutput .. "PNPDeviceID: " .. Escape(oItem:PNPDeviceID()) .. "\r\n"; sOutput = sOutput .. "PowerManagementCapabilities: " .. Escape(oItem:PowerManagementCapabilities()) .. "\r\n"; sOutput = sOutput .. "PowerManagementSupported: " .. Escape(oItem:PowerManagementSupported()) .. "\r\n"; sOutput = sOutput .. "ProviderName: " .. Escape(oItem:ProviderName()) .. "\r\n"; sOutput = sOutput .. "Purpose: " .. Escape(oItem:Purpose()) .. "\r\n"; sOutput = sOutput .. "QuotasDisabled: " .. Escape(oItem:QuotasDisabled()) .. "\r\n"; sOutput = sOutput .. "QuotasIncomplete: " .. Escape(oItem:QuotasIncomplete()) .. "\r\n"; sOutput = sOutput .. "QuotasRebuilding: " .. Escape(oItem:QuotasRebuilding()) .. "\r\n"; sOutput = sOutput .. "SessionID: " .. Escape(oItem:SessionID()) .. "\r\n"; sOutput = sOutput .. "Size: " .. Escape(oItem:Size()) .. "\r\n"; sOutput = sOutput .. "Status: " .. Escape(oItem:Status()) .. "\r\n"; sOutput = sOutput .. "StatusInfo: " .. Escape(oItem:StatusInfo()) .. "\r\n"; sOutput = sOutput .. "SupportsDiskQuotas: " .. Escape(oItem:SupportsDiskQuotas()) .. "\r\n"; sOutput = sOutput .. "SupportsFileBasedCompression: " .. Escape(oItem:SupportsFileBasedCompression()) .. "\r\n"; sOutput = sOutput .. "SystemCreationClassName: " .. Escape(oItem:SystemCreationClassName()) .. "\r\n"; sOutput = sOutput .. "SystemName: " .. Escape(oItem:SystemName()) .. "\r\n"; sOutput = sOutput .. "VolumeName: " .. Escape(oItem:VolumeName()) .. "\r\n"; sOutput = sOutput .. "VolumeSerialNumber: " .. Escape(oItem:VolumeSerialNumber()) .. "\r\n"; if (Dialog.Message("WMI Output", sOutputTitle .. sOutput, 1) == 2) then break; end sOutput = ""; oItem = oEnum:Next(); end else Dialog.Message("WMI Output", "No WMI Objects Found for class: Win32_MappedLogicalDisk"); end Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 12, 2013 Author Share Posted August 12, 2013 AutoIt.DriveMapAdd("X:", "\\\\192.168.1.2\\folder", 0, "user", "pass") Numara = 1 local tbImg = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "Pictures (.png, .jpg, .tif)|*.png;*.jpg;*.tif|", "", "dat", false, false); if (tbImg[1] ~= "CANCEL") then local ext=String.SplitPath(tbImg[1]).Extension; File.Copy(tbImg[1], "X:\\resimler\\"..Numara.""..ext, true, true, false, true, nil); Input.SetText("Input1","\\\\192.168.1.2\\folder\\resimler\\"..Numara..""..ext); Image.Load("Image1", "X:\\resimler\\"..Numara..""..ext); end AutoIt.DriveMapDel("X:") --- bu kodu kullandığımda dosya upload işi bitmeden map siliniyor, acaba upload bittikten sonra silmesini nasıl sağlarım ? Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 12, 2013 Editor Share Posted August 12, 2013 Global Function function kopyala(FileTotal,FileCopied) if FileTotal == FileCopied then --Map lenen sürücüyü sil end end Buton veya nerede kullanacaksan. File.Copy("C:\\MyDir\\*.*", "C:\\DestDir\\", true, true, false, true, kopyala); Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 12, 2013 Author Share Posted August 12, 2013 Yanlış mı yapıyorum pairs ? olmadı... Button code: AutoIt.DriveMapAdd("X:", "\\\\192.168.1.2\\folder", 0, "user", "pass") Numara = 1 local tbImg = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "Pictures (.png, .jpg, .tif)|*.png;*.jpg;*.tif|", "", "dat", false, false); if (tbImg[1] ~= "CANCEL") then local ext=String.SplitPath(tbImg[1]).Extension; File.Copy(tbImg[1], "X:\\resimler\\"..Numara.""..ext, true, true, false, true, kopyala); Image.Load("Image1", "X:\\resimler\\"..Numara..""..ext); end Global code: function kopyala(FileTotal,FileCopied) if FileTotal == FileCopied then AutoIt.DriveMapDel("X:") end end Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 12, 2013 Editor Share Posted August 12, 2013 Fonksiyondaki FileTotal ve FileCopied ı Total ve Copied olarak değiştirip denermisin sana zahmet.Başka çözüm oylu bakıyorum bende. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 12, 2013 Author Share Posted August 12, 2013 sanırım gerek kalmadı oldu gibi ama şöyle birşey fark ettim autoit plugin ile mapleme yaparken sorun oluyor sanırım mapleme olmadı taki ben manuel olarak network drive windows explorer da açana kadar... Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 12, 2013 Editor Share Posted August 12, 2013 sanırım gerek kalmadı oldu gibi ama şöyle birşey fark ettim autoit plugin ile mapleme yaparken sorun oluyor sanırım mapleme olmadı taki ben manuel olarak network drive windows explorer da açana kadar... Map lemeye gerek kalmayacak eve geçeyim ufak bi ayar çekicem. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 12, 2013 Editor Share Posted August 12, 2013 Aklıma şu geldi manuel olarak denediğimde çalıştı ams ile kullanıldıgındada çalışacagını umuyorum bi denersin map yapıp silmene gerek kalmaz hem. otantike = File.Run("cmd", "/C net use \\192.168.1.2\folder /USER:domain\kullaniciadi password", _WindowsFolder.."\\System32", SW_HIDE, false); File.Copy("C:\\MyDir\\*.*", "\\192.168.1.2\\folder", true, true, false, true, nil); Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted August 12, 2013 Author Share Posted August 12, 2013 File.Run("cmd", "/C net use \\\\192.168.1.2\\folder /USER:muratboy31 123456", _WindowsFolder.."\\System32", SW_HIDE, false); File.Copy("AutoPlay\\Docs\\Test.Pdf", "\\\\192.168.1.2\\folder", true, true, false, true, nil); bu şekilde çalıştı ama şöyle bir sorun çıktı... program kapanmıyor dosya attıktan sonra belli bir süre... Quote Link to comment Share on other sites More sharing options...
fba44 Posted August 12, 2013 Share Posted August 12, 2013 File.Run("cmd", "/C net use \\\\192.168.1.2\\folder /USER:muratboy31 123456", _WindowsFolder.."\\System32", SW_HIDE, false); File.Copy("AutoPlay\\Docs\\Test.Pdf", "\\\\192.168.1.2\\folder", true, true, false, true, nil); bu şekilde çalıştı ama şöyle bir sorun çıktı... program kapanmıyor dosya attıktan sonra belli bir süre... yanlış hatırlamıyorsam bu şekilde map kalıcı oluyor ama 123456 nın sonuna /persistent:no yani File.Run("cmd", "/C net use \\\\192.168.1.2\\folder /USER:muratboy31 123456 /persistent:no", _WindowsFolder.."\\System32", SW_HIDE, false); komutunu eklerseniz maplemeyi geçici olarak yapacaktır. Bilginize Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.