اذهب الي المحتوي
أوفيسنا

موقع الجهاز


moamen salem
إذهب إلى أفضل إجابة Solved by jjafferr,

الردود الموصى بها

في ٦‏/١‏/٢٠٢٢ at 09:03, ابو جودي said:

الله يبارك لك جزاكم الله خيرا

كنت ناوى اسال على صلاحيات بشكل محدد وروحت لقناتك ولاقيت حد سال وعرفت انها بمقابل مادى وكمان مش عارف هى اللى انا عاوز اسال عنها واللا لاء

علشان كده غيرت رأيى :yes:

لان انا كنت محتاج اساعد الاستاذ abouelhassan

فى موضوعه بس المشكلة انا مش عارف الية عمل الصلاخيات هنا ولا فكرتها ايه وبصراحة مشغول حبتين مشفاضى اقعد احلل هههههههههههههههه

علشان كده كمان غيرت راى

 

 

23 ساعات مضت, jjafferr said:

وعليكم السلام 🙂

 

طريقة تعرّف المواقع على مكان تواجدك عند الدخول اليها ، هو عن طريق IP الكمبيوتر ،

وهذه طريقة لمعرفة IP الكمبيوتر :

 

.

جعفر

معذرا استاذي الكريم

انا محتاج موقع الجهاز في اي دولة وليس IP

رابط هذا التعليق
شارك

1 ساعه مضت, moamen salem said:

انا محتاج موقع الجهاز في اي دولة وليس IP

السلام عليكم ,, اذا سمحلى استاذنا @jjafferr  بالمناقشة فى الموضوع , البداية اخى الكريم هى انك تحصل على IP ثم تبحث عن موقعه لمعرفة المدينة والدولة والوقت الخ ..

وبالتالى نظرياً يلزمك انك تحصل على IP ثم يكون عندك نموذج به متصفح , الق نظرة على هذه الاداة الرائعة لأستاذنا صالح حمادى :

 

ثم استخدم ما تعلمت منها وادخل على الموقع التالى بواسطة الاداة ثم قم بتمرير IP الذى حصلت عليه فى مربع البحث الخاص بالموقع التالى مثلا :

https://www.geolocation.com

والنتيجة ستكون كالتالى :

Capture.PNG.29de8e9d075f3d86e5bf73eb8a4d8e84.PNG

 بالتوفيق

تم تعديل بواسطه Amr Ashraf
اثراء المشاركة
  • Like 1
رابط هذا التعليق
شارك

4 ساعات مضت, Amr Ashraf said:

السلام عليكم ,, اذا سمحلى استاذنا @jjafferr  بالمناقشة فى الموضوع , البداية اخى الكريم هى انك تحصل على IP ثم تبحث عن موقعه لمعرفة المدينة والدولة والوقت الخ ..

وبالتالى نظرياً يلزمك انك تحصل على IP ثم يكون عندك نموذج به متصفح , الق نظرة على هذه الاداة الرائعة لأستاذنا صالح حمادى :

 

ثم استخدم ما تعلمت منها وادخل على الموقع التالى بواسطة الاداة ثم قم بتمرير IP الذى حصلت عليه فى مربع البحث الخاص بالموقع التالى مثلا :

https://www.geolocation.com

والنتيجة ستكون كالتالى :

Capture.PNG.29de8e9d075f3d86e5bf73eb8a4d8e84.PNG

 بالتوفيق

شكرا يا استاذنا انا حاولت كتير ومنفعش اكون شاكر لحضرتك لو قدرت تعملها في ملف وترسلها 

رابط هذا التعليق
شارك

1 ساعه مضت, moamen salem said:

شكرا يا استاذنا انا حاولت كتير ومنفعش اكون شاكر لحضرتك لو قدرت تعملها في ملف وترسلها 

اعذرنى لضيق الوقت انا حبيت اوضحلك الطريقة فقط ولكن تطبيقها يحتاج وقت .. عسى ان احد الاساتذة عنده طريقة افضل .

فى حالة توافر الوقت سأحاول عمل مثال لك . بالتوفيق

رابط هذا التعليق
شارك

  • أفضل إجابة

تفضل يا سيدي:

 

النموذج يظهر لك جميع البيانات ، ولكن يجب ان تكون متصل بالانترنت

image.png.98f9697b7d446d30af3e10168f46735f.png

.

كود حدث "عند النقر" على الزر في النموذج :

Private Sub cmd_IP_Country_Click()

    Dim city_IP As String
    Dim public_IP As String
    
    Me.my_PC_MAC = GetMyMACAddress
    Me.my_Local_IP = GetMyLocalIP
    Me.my_country_IP = IPcountry(city_IP, public_IP)
    Me.my_country_IP = DLookup("[Country_A]", "tbl_Countries_Currency_Codes", "Country_Code_E2='" & Me.my_country_IP & "'")
    Me.my_Public_IP = public_IP
    Me.my_city_IP = city_IP

End Sub

.

والوحدات النمطية التي تقوم بالعمل:

Option Compare Database
Option Explicit

'----------------------------------------------------------------------------
'This module contains 3 functions for determing the public IP, the local IP
'and the MAC address of the computer that runs those functions.
' 
'Written By:    Christos Samaras
'Date:          22/11/2014
'E-mail:        xristos.samaras@gmail.com
'Site:          http://www.myengineeringworld.net
'----------------------------------------------------------------------------

Function GetMyPublicIP() As String

    Dim HttpRequest As Object
    
    On Error Resume Next

    'Create the XMLHttpRequest object.
    Set HttpRequest = CreateObject("MSXML2.XMLHTTP")
    
    'Check if the object was created.
    If Err.Number <> 0 Then
         'Return error message.
        GetMyPublicIP = "Could not create the XMLHttpRequest object!"
         'Release the object and exit.
        Set HttpRequest = Nothing
        Exit Function
    End If
    
    On Error GoTo 0

     'Create the request - no special parameters required.
     HttpRequest.Open "GET", "http://myip.dnsomatic.com", False

     'Send the request to the site.
    HttpRequest.send

     'Return the result of the request (the IP string).
    GetMyPublicIP = HttpRequest.responseText

End Function


Function GetMyLocalIP() As String

     'Declaring the necessary variables.
    Dim strComputer     As String
    Dim objWMIService   As Object
    Dim colItems        As Object
    Dim objItem         As Object
    Dim myIPAddress     As String
    
     'Set the computer.
    strComputer = "."

     'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

     'A select query is used to get a collection of IP addresses from the network adapters that have the property IPEnabled equal to true.
    Set colItems = objWMIService.ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

     'Loop through all the objects of the collection and return the first non-empty IP.
    For Each objItem In colItems
        If Not IsNull(objItem.IPAddress) Then myIPAddress = Trim(objItem.IPAddress(0))
        Exit For
    Next

     'Return the IP string.
    GetMyLocalIP = myIPAddress

End Function


Function GetMyMACAddress() As String

     'Declaring the necessary variables.
    Dim strComputer     As String
    Dim objWMIService   As Object
    Dim colItems        As Object
    Dim objItem         As Object
    Dim myMACAddress As String

     'Set the computer.
    strComputer = "."

     'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

     'A select query is used to get a collection of network adapters that have the property IPEnabled equal to true.
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

     'Loop through all the collection of adapters and return the MAC address of the first adapter that has a non-empty IP.
    For Each objItem In colItems
        If Not IsNull(objItem.IPAddress) Then myMACAddress = objItem.MACAddress
        Exit For
    Next

     'Return the IP string.
    GetMyMACAddress = myMACAddress

End Function

Function IPcountry(IPcity As String, IPPublic As String) As String

'
'from: https://www.mrexcel.com/board/threads/need-to-get-location-based-on-ip-address-in-vba.1115981/
'edited by jjafferr 20-01-22
'we don't send any values when calling the Function, but return 3 values
'

Dim http As Object
Dim xmlDoc As MSXML2.DOMDocument60
Dim strURL As String

' requires reference to Microsoft XML 6.0

    IPPublic = GetMyPublicIP

    strURL = "https://ipapi.co/" & IPPublic & "/xml/"
        
    Set http = CreateObject("MSXML2.XMLHTTP")
    
    http.Open "GET", strURL, False
    
    http.send
    Set xmlDoc = New MSXML2.DOMDocument60
    
    xmlDoc.LoadXML http.responseText
    
    'Debug.Print http.responseText
    IPcity = xmlDoc.SelectSingleNode("//root/city").Text
    IPcountry = xmlDoc.SelectSingleNode("//root/country").Text

End Function

.

والدالة الاخيرة هي التي يتم مناداتها من النموذج ، 

اضفت شيء فيه لإرجاع البيانات للنموذج ، فعند مناداة الدالة ، لا نرسل لها اي قيمة ، وانما هي تُرجع 3 قيم للنموذج ، فالطريقة لطيفة للنظر فيها 🙂

 

اسم الدولة التي تُرجعه الدالة هو اختصار اسم الدولة ، فأرفقت احد جداول من احد برامجي فيه بقية بيانات الدوله ، وبقية الدول (الجدول عمره حوالي 8 سنوات ، فقد تكون هناك دول جديدة نشأة من وقتها ، فعليه ، يجب عليك تحديث الجدول 🙂)

 

جعفر

1452.IP Country.accdb.zip

  • Like 1
  • Thanks 3
رابط هذا التعليق
شارك

  • 2 weeks later...
في ١٩‏/١‏/٢٠٢٢ at 23:19, jjafferr said:

تفضل يا سيدي:

 

النموذج يظهر لك جميع البيانات ، ولكن يجب ان تكون متصل بالانترنت

image.png.98f9697b7d446d30af3e10168f46735f.png

.

كود حدث "عند النقر" على الزر في النموذج :

Private Sub cmd_IP_Country_Click()

    Dim city_IP As String
    Dim public_IP As String
    
    Me.my_PC_MAC = GetMyMACAddress
    Me.my_Local_IP = GetMyLocalIP
    Me.my_country_IP = IPcountry(city_IP, public_IP)
    Me.my_country_IP = DLookup("[Country_A]", "tbl_Countries_Currency_Codes", "Country_Code_E2='" & Me.my_country_IP & "'")
    Me.my_Public_IP = public_IP
    Me.my_city_IP = city_IP

End Sub

.

والوحدات النمطية التي تقوم بالعمل:

Option Compare Database
Option Explicit

'----------------------------------------------------------------------------
'This module contains 3 functions for determing the public IP, the local IP
'and the MAC address of the computer that runs those functions.
' 
'Written By:    Christos Samaras
'Date:          22/11/2014
'E-mail:        xristos.samaras@gmail.com
'Site:          http://www.myengineeringworld.net
'----------------------------------------------------------------------------

Function GetMyPublicIP() As String

    Dim HttpRequest As Object
    
    On Error Resume Next

    'Create the XMLHttpRequest object.
    Set HttpRequest = CreateObject("MSXML2.XMLHTTP")
    
    'Check if the object was created.
    If Err.Number <> 0 Then
         'Return error message.
        GetMyPublicIP = "Could not create the XMLHttpRequest object!"
         'Release the object and exit.
        Set HttpRequest = Nothing
        Exit Function
    End If
    
    On Error GoTo 0

     'Create the request - no special parameters required.
     HttpRequest.Open "GET", "http://myip.dnsomatic.com", False

     'Send the request to the site.
    HttpRequest.send

     'Return the result of the request (the IP string).
    GetMyPublicIP = HttpRequest.responseText

End Function


Function GetMyLocalIP() As String

     'Declaring the necessary variables.
    Dim strComputer     As String
    Dim objWMIService   As Object
    Dim colItems        As Object
    Dim objItem         As Object
    Dim myIPAddress     As String
    
     'Set the computer.
    strComputer = "."

     'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

     'A select query is used to get a collection of IP addresses from the network adapters that have the property IPEnabled equal to true.
    Set colItems = objWMIService.ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

     'Loop through all the objects of the collection and return the first non-empty IP.
    For Each objItem In colItems
        If Not IsNull(objItem.IPAddress) Then myIPAddress = Trim(objItem.IPAddress(0))
        Exit For
    Next

     'Return the IP string.
    GetMyLocalIP = myIPAddress

End Function


Function GetMyMACAddress() As String

     'Declaring the necessary variables.
    Dim strComputer     As String
    Dim objWMIService   As Object
    Dim colItems        As Object
    Dim objItem         As Object
    Dim myMACAddress As String

     'Set the computer.
    strComputer = "."

     'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

     'A select query is used to get a collection of network adapters that have the property IPEnabled equal to true.
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

     'Loop through all the collection of adapters and return the MAC address of the first adapter that has a non-empty IP.
    For Each objItem In colItems
        If Not IsNull(objItem.IPAddress) Then myMACAddress = objItem.MACAddress
        Exit For
    Next

     'Return the IP string.
    GetMyMACAddress = myMACAddress

End Function

Function IPcountry(IPcity As String, IPPublic As String) As String

'
'from: https://www.mrexcel.com/board/threads/need-to-get-location-based-on-ip-address-in-vba.1115981/
'edited by jjafferr 20-01-22
'we don't send any values when calling the Function, but return 3 values
'

Dim http As Object
Dim xmlDoc As MSXML2.DOMDocument60
Dim strURL As String

' requires reference to Microsoft XML 6.0

    IPPublic = GetMyPublicIP

    strURL = "https://ipapi.co/" & IPPublic & "/xml/"
        
    Set http = CreateObject("MSXML2.XMLHTTP")
    
    http.Open "GET", strURL, False
    
    http.send
    Set xmlDoc = New MSXML2.DOMDocument60
    
    xmlDoc.LoadXML http.responseText
    
    'Debug.Print http.responseText
    IPcity = xmlDoc.SelectSingleNode("//root/city").Text
    IPcountry = xmlDoc.SelectSingleNode("//root/country").Text

End Function

.

والدالة الاخيرة هي التي يتم مناداتها من النموذج ، 

اضفت شيء فيه لإرجاع البيانات للنموذج ، فعند مناداة الدالة ، لا نرسل لها اي قيمة ، وانما هي تُرجع 3 قيم للنموذج ، فالطريقة لطيفة للنظر فيها 🙂

 

اسم الدولة التي تُرجعه الدالة هو اختصار اسم الدولة ، فأرفقت احد جداول من احد برامجي فيه بقية بيانات الدوله ، وبقية الدول (الجدول عمره حوالي 8 سنوات ، فقد تكون هناك دول جديدة نشأة من وقتها ، فعليه ، يجب عليك تحديث الجدول 🙂)

 

جعفر

1452.IP Country.accdb.zip 42.43 kB · 9 downloads

استاذي الكريم شاكر لحضرتك جدااااااااااا وفعلا بعد ما دخلت المنتدي دا وتعرفت علي العملاقة اللي فيه وحضرتك اولهم عرفت ان الاكسس بقدوره عمل اي شئ بمعني الكلمة 

وبعتذر جدا عن تاخير الرد لان للاسف مش بيوصلني اي اشعار معرفش ليه يعني حاليا دخلت علي صفحتي بالصدفة وعرفت ان حضرتك رديت

 

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

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

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information