turkoglu98 Posted July 27, 2013 Share Posted July 27, 2013 arkadaşlar bir programıma istatistik bölümü yapıyordum ve doğru olması için modemin ip adresi alınması gerekiyor. ama bir türlü alamadım. aslında sitelerden veri çekerek yapılabiliyor ama programı çok kasıyor bazen yanıt vermiyor. bunun daha kolay bir yolunu bilen var mı? 192.168 gibi olan ip adresini değil direk modemin adresi lazım Quote Link to comment Share on other sites More sharing options...
reyiz Posted July 29, 2013 Share Posted July 29, 2013 AMS'de öyle bir işlev yok. AutoIt plugin veya AutoIt yardımıyla yapabilirsiniz. Quote Link to comment Share on other sites More sharing options...
radyofon Posted July 29, 2013 Share Posted July 29, 2013 ipconfig ile alıp txt file'ya yazdırıp içerisinden çekebilirsin. Benimkisi sadece bir fikir. Nasıl yapılacağı konusunda yardımcı olamayacağım. Quote Link to comment Share on other sites More sharing options...
reyiz Posted July 29, 2013 Share Posted July 29, 2013 ipconfig yerel IP adresini gösterir. Quote Link to comment Share on other sites More sharing options...
muratboy31 Posted July 29, 2013 Share Posted July 29, 2013 HTTP.Download("http://www.ipchicken.com/", _TempFolder .. "\\tempfile", MODE_TEXT); error = Application.GetLastError(); if (error == 0) then page = TextFile.ReadToString(_TempFolder .. "\\tempfile"); File.Delete(_TempFolder .. "\\tempfile", false, false, true); ip = string.sub(page, string.find(page, '%d+%.%d+%.%d+%.%d+')); if (ip ~= nil) then error = 0; Dialog.Message("", "Ip adresim: "..ip..") end end Quote Link to comment Share on other sites More sharing options...
radyofon Posted July 29, 2013 Share Posted July 29, 2013 ipconfig yerel IP adresini gösterir. Yanılıyorsun varsayılan ağ geçidini de gösterir. O da modemin ip nosudur. Quote Link to comment Share on other sites More sharing options...
reyiz Posted July 29, 2013 Share Posted July 29, 2013 192.168 gibi olan adres değil diyor, modemin adresi de bu formattadır. Modemin IP adresi derken geniş ağda kullanılan IP adresini kastediyor galiba. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted July 29, 2013 Editor Share Posted July 29, 2013 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 oWMIService = luacom.GetObject("winmgmts:\\\\localhost\\root\\CIMV2"); local oColItems = oWMIService:ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration", "WQL", 48); if oColItems then local oEnum = luacom.GetEnumerator(oColItems); local oItem = oEnum:Next(); while oItem do if Escape(oItem:DefaultIPGateway()) ~= "" then sOutput = Escape(oItem:DefaultIPGateway()); end oItem = oEnum:Next(); end Dialog.Message("WMI (Windows Kütüphanesi) Çıktısı",sOutput); else Dialog.Message("WMI (Windows Kütüphanesi) Çıktısı", ""); end Bu kod sana varsayılan ağ geçidin yani ney üzerinden internete çıkıyorsun modemse modemin ip si. onu verir.Kullana bilmen için LUA pluginini aktif etmen lazım. Quote Link to comment Share on other sites More sharing options...
turkoglu98 Posted July 31, 2013 Author Share Posted July 31, 2013 arkadaşlar benim istediğim 192.168 li olan değil ipchicken.com sitesinde görüntülen ip adresi; mesela: 78.174.72.100 HTTP.Download("http://www.ipchicken.com/", _TempFolder .. "\\tempfile", MODE_TEXT); error = Application.GetLastError(); if (error == 0) then page = TextFile.ReadToString(_TempFolder .. "\\tempfile"); File.Delete(_TempFolder .. "\\tempfile", false, false, true); ip = string.sub(page, string.find(page, '%d+%.%d+%.%d+%.%d+')); if (ip ~= nil) then error = 0; Dialog.Message("", "Ip adresim: "..ip..") end end bu kod işe yarıyor ama programı çok kasıyor bunun alternatif bir yolu yokmu Quote Link to comment Share on other sites More sharing options...
TuTaMixx Posted July 31, 2013 Share Posted July 31, 2013 İnternetten çekmeden bulabileceğini sanmıyorum. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted July 31, 2013 Editor Share Posted July 31, 2013 Bi bakalım çeke biliriz belki Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted July 31, 2013 Editor Share Posted July 31, 2013 Bu şekilde aldım arkadaşlar IP yi işini görürmü bilemem. tblA = CommandLine.Execute("ping google.com", 0); str = ""; for j,k in pairs(tblA) do str = k; end ilk = String.Find(str, "[", 1, false); son = String.Find(str, "]", 1, false); result = String.Mid(str, ilk + 1,(son - ilk) -1); Dialog.Message("",result); Projede CommandLine pluginini aktif etmen lazım. Quote Link to comment Share on other sites More sharing options...
turkoglu98 Posted August 2, 2013 Author Share Posted August 2, 2013 teşekkür ederim bu işe yaradı Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted August 2, 2013 Editor Share Posted August 2, 2013 Yeni gördüm ya yanlış veri çekmişim.Bu şekilde geçrek IP yi alamazsınız.Web üzerinden çekecekseniz başka yöntemlerde var. Quote Link to comment Share on other sites More sharing options...
justpl4y Posted August 2, 2013 Share Posted August 2, 2013 (edited) http://myexternalip.com/raw sayfada sadece dış ip'yi gösteriyor. veya icanhazip.com Cmd için curl vasıtasıyla yine aynı site üzerinden ip çekilebiliyor.http://curl.haxx.se/download.html bkz: curl "http://myexternalip.com/raw" Edited August 2, 2013 by justpl4y Quote Link to comment Share on other sites More sharing options...
fba44 Posted August 2, 2013 Share Posted August 2, 2013 http://myexternalip.com/raw sayfada sadece dış ip'yi gösteriyor. veya icanhazip.com Cmd için curl vasıtasıyla yine aynı site üzerinden ip çekilebiliyor.http://curl.haxx.se/download.html bkz: curl "http://myexternalip.com/raw" Kardeş güzel bilgi vermişsin tşk ederim cmd ile bulmak gerçekten merak ettiğim bir konuydu peki extra curl vs bir paket kullanmadan bulma imkanımız varmı wan ip yi ? Quote Link to comment Share on other sites More sharing options...
justpl4y Posted August 3, 2013 Share Posted August 3, 2013 Sabit ip kullanıyorsan mümkün olabilir de, adsl modemde komutlarla alabileceğin ip'ne en yakın şey ttnet'in ağ geçididir. 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.