C# · 12月 27, 2021

c# – 如何使用USPS验证给定的地址?



解决方法 从 here ///Create a new instance of the USPS Manager class///The constructor takes 2 arguments,the first is///your USPS Web Tools User ID and the second is ///true if you want to use the USPS Test Servers.USPSManager m = new USPSManager(“YOUR_USER_ID”,true);Address a = new Address();a.Address2 = “6406 Ivy Lane”;a.City = “Greenbelt”;a.State = “MD”;///By calling ValidateAddress on the USPSManager object,///you get an Address object that has been validated by the///USPS serversAddress validatedAddress = m.ValidateAddress(a);