Calling a Static method in C#

前端 未结 5 1517
[愿得一人]
[愿得一人] 2021-02-19 11:46

How do I call a static method? I want to call this from a class I have created, I want to get the location from IP. I\'ve declared it but what I need to do is call the method...

5条回答
  •  爱一瞬间的悲伤
    2021-02-19 12:13

    It's as easy as:

    LocationTools.GetLocationFromIP(strIP, strCity, strRegion, strCountry, fLat, fLong)
    

    Just call the Class, and straight from that the method. Static means that you do not need an instance of the class to call the method.

提交回复
热议问题