{"id":91,"date":"2016-02-26T15:27:56","date_gmt":"2016-02-26T13:27:56","guid":{"rendered":"http:\/\/www.erdoganozkaya.com.tr\/?p=91"},"modified":"2016-02-26T15:28:13","modified_gmt":"2016-02-26T13:28:13","slug":"ip-ve-mac-adresi-yerel-bulmak","status":"publish","type":"post","link":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/ip-ve-mac-adresi-yerel-bulmak.html","title":{"rendered":"IP ve MAC adresi (yerel) bulmak"},"content":{"rendered":"<p>\u015fa\u011f\u0131da kullan\u0131c\u0131 giri\u015fi i\u00e7in bir IP MAC adresini bulmak i\u00e7in basit bir uygulama in\u015fa edecek \u2026<\/p>\n<p>MacFinder adl\u0131 yeni bir Windows Forms uygulamas\u0131 a\u00e7\u0131n<\/p>\n<p>Form ve 2 yerine metin kutular\u0131n\u0131n 1 Button A\u00e7\u0131k<\/p>\n<p>Sonra Explorer MacFinder proje adl\u0131 bir s\u0131n\u0131f eklemek sa\u011f t\u0131klay\u0131n ve add-&gt; s\u0131n\u0131f\u0131<\/p>\n<p>\u0130\u015fte yorumlar a\u00e7\u0131klamalar ile s\u0131n\u0131f<span id=\"more-70\"><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td title=\"Show Plain undefined Code\">\u00a0C#\u00a0|<\/td>\n<td><\/td>\n<td><\/td>\n<td title=\"DevFormatter Plugin\">?<\/td>\n<td width=\"99%\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td width=\"1%\">01<\/td>\n<td>\n<pre>using System;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">02<\/td>\n<td>\n<pre>using System.Linq;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">03<\/td>\n<td>\n<pre>using System.Text;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">04<\/td>\n<td>\n<pre>using System.Diagnostics;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">05<\/td>\n<td>\n<pre>using System.Windows.Forms;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">06<\/td>\n<td>\n<pre>using System.IO;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">07<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">08<\/td>\n<td>\n<pre>class MacFinder<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">09<\/td>\n<td>\n<pre>    {<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">10<\/td>\n<td>\n<pre>        public string FindMac(string ip)<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">11<\/td>\n<td>\n<pre>        {<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">12<\/td>\n<td>\n<pre>            string mac = null;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">13<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">14<\/td>\n<td>\n<pre>            \/\/\u03a0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03bf\u03cd\u03bc\u03b5 \u03bc\u03b9\u03b1 \u03b4\u03b9\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03b5\u03c3\u03c4\u03ae \u03c3\u03c4\u03b7\u03bd \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae \u03b5\u03bd\u03c4\u03bf\u03bb\u03ce\u03bd<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">15<\/td>\n<td>\n<pre>            Process process = new Process();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">16<\/td>\n<td>\n<pre>            ProcessStartInfo processStartInfo = new ProcessStartInfo();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">17<\/td>\n<td>\n<pre>            \/\/\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf (\u03b7 \u03b5\u03bd\u03c4\u03bf\u03bb\u03ae \u03c0\u03bf\u03c5 \u03b8\u03b1 \u03b5\u03ba\u03c4\u03b5\u03bb\u03b5\u03c3\u03c4\u03ae)<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">18<\/td>\n<td>\n<pre>            processStartInfo.FileName = \"arp\";<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">19<\/td>\n<td>\n<pre>            \/\/\u03a0\u03b1\u03c1\u03ac\u03bc\u03b5\u03c4\u03c1\u03bf\u03b9 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 (\u03b5\u03bd\u03c4\u03bf\u03bb\u03ae\u03c2)<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">20<\/td>\n<td>\n<pre>            processStartInfo.Arguments = \"-a \" + ip;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">21<\/td>\n<td>\n<pre>            processStartInfo.RedirectStandardInput = false;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">22<\/td>\n<td>\n<pre>            processStartInfo.RedirectStandardOutput = true;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">23<\/td>\n<td>\n<pre>            processStartInfo.UseShellExecute = false;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">24<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">25<\/td>\n<td>\n<pre>            try<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">26<\/td>\n<td>\n<pre>            {<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">27<\/td>\n<td>\n<pre>                \/\/\u039e\u03b5\u03ba\u03b9\u03bd\u03ac\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b4\u03b9\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03bc\u03b1\u03c2<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">28<\/td>\n<td>\n<pre>                process = Process.Start(processStartInfo);<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">29<\/td>\n<td>\n<pre>                string line;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">30<\/td>\n<td>\n<pre>                line = process.StandardOutput.ReadLine();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">31<\/td>\n<td>\n<pre>                StreamReader streamReader = process.StandardOutput;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">32<\/td>\n<td>\n<pre>                string cmdString = null;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">33<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">34<\/td>\n<td>\n<pre>                \/\/\u0395\u03c0\u03b5\u03b9\u03b4\u03ae \u03bc\u03b1\u03c2 \u03b4\u03b5\u03af\u03bd\u03b5\u03b9 3 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ad\u03c2 \u03b4\u03b9\u03b1\u03b2\u03ac\u03b6\u03bf\u03c5\u03bc\u03b5 \u03bc\u03ad\u03c7\u03c1\u03b9 \u03c4\u03b7\u03bd<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">35<\/td>\n<td>\n<pre>                \/\/3\u03b7 \u03ba\u03b1\u03b9 \u03c7\u03c1\u03ae\u03c3\u03b9\u03bc\u03b7 \u03b3\u03c1\u03b1\u03bc\u03bc\u03ae<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">36<\/td>\n<td>\n<pre>                cmdString = streamReader.ReadLine();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">37<\/td>\n<td>\n<pre>                cmdString = streamReader.ReadLine();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">38<\/td>\n<td>\n<pre>                cmdString = streamReader.ReadLine();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">39<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">40<\/td>\n<td>\n<pre>                \/\/\u0392\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c1\u03c7\u03ae \u03c4\u03b7\u03c2 MAC<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">41<\/td>\n<td>\n<pre>                int first = cmdString.IndexOf('-');<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">42<\/td>\n<td>\n<pre>                int startPoint = first - 2;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">43<\/td>\n<td>\n<pre>                int macLength = (2 * 6) + 5; \/\/ 6 x 'FF' &amp; 5 x '-' = \u039c\u03ae\u03ba\u03bf\u03c2 MAC<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">44<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">45<\/td>\n<td>\n<pre>                \/\/\u039a\u03cc\u03b2\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 MAC<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">46<\/td>\n<td>\n<pre>                mac = cmdString.Substring(startPoint, macLength);<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">47<\/td>\n<td>\n<pre>            }<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">48<\/td>\n<td>\n<pre>            \/\/\u0395\u03ac\u03bd \u03c0\u03b1\u03c1\u03bf\u03c5\u03c3\u03b9\u03b1\u03c3\u03c4\u03ae \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c4\u03b7\u03bd \u03b5\u03bc\u03c6\u03b1\u03bd\u03af\u03b6\u03bf\u03c5\u03bc\u03b5<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">49<\/td>\n<td>\n<pre>            catch (Exception e)<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">50<\/td>\n<td>\n<pre>            {<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">51<\/td>\n<td>\n<pre>                MessageBox.Show(\"\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 !!! \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b7\u03bd \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 IP\");<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">52<\/td>\n<td>\n<pre>            }<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">53<\/td>\n<td>\n<pre>            \/\/\u03a0\u03b5\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5\u03bc\u03b5 \u03b3\u03b9\u03b1\u0384\u03c4\u03b7\u03bd \u03ad\u03be\u03bf\u03b4\u03bf \u03c4\u03b7\u03c2 \u03b4\u03b9\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2 \u03ba\u03b1\u03b9 \u03c4\u03b7\u03bd \u03ba\u03bb\u03b5\u03af\u03bd\u03bf\u03c5\u03bc\u03b5<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">54<\/td>\n<td>\n<pre>            process.WaitForExit();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">55<\/td>\n<td>\n<pre>            process.Close();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">56<\/td>\n<td>\n<pre>            return mac;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">57<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">58<\/td>\n<td>\n<pre>        }<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">59<\/td>\n<td>\n<pre>    }<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">60<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">61<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Ve son d\u00fc\u011fmesinin click olay\u0131 a\u015fa\u011f\u0131daki kodu yaz\u0131n:<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td title=\"Show Plain undefined Code\">\u00a0C#\u00a0|<\/td>\n<td><object id=\"ZeroClipboard2\" width=\"16px\" height=\"16px\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\" align=\"middle\"><embed id=\"ZeroClipboard2\" width=\"16px\" height=\"16px\" type=\"application\/x-shockwave-flash\" src=\"http:\/\/phantom.gr\/wp-content\/plugins\/devformatter\/_zclipboard.swf\" loop=\"loop\" menu=\"false\" quality=\"best\" allowscriptaccess=\"always\" allowfullscreen=\"allowfullscreen\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" flashvars=\"id=2&amp;width=16&amp;height=16\" wmode=\"transparent\" title=\"Double-click to copy\" align=\"middle\" bgcolor=\"#ffffff\" \/><\/object><\/td>\n<td>\u00a0copy\u00a0code\u00a0|<\/td>\n<td title=\"DevFormatter Plugin\">?<\/td>\n<td width=\"99%\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td width=\"1%\">1<\/td>\n<td>\n<pre> string ip = textBox1.Text;<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">2<\/td>\n<td>\n<pre>            MacFinder macFinder = new MacFinder();<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"1%\">3<\/td>\n<td>\n<pre>            textBox2.Text = macFinder.FindMac(ip);<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u015fa\u011f\u0131da kullan\u0131c\u0131 giri\u015fi i\u00e7in bir IP MAC adresini bulmak i\u00e7in basit bir uygulama in\u015fa edecek \u2026 MacFinder adl\u0131 yeni bir Windows Forms uygulamas\u0131 a\u00e7\u0131n Form [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":87,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,4,3],"tags":[37,38,36],"_links":{"self":[{"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":1,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":92,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/91\/revisions\/92"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/media\/87"}],"wp:attachment":[{"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.erdoganozkaya.com.tr\/index.php\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}