1, first introduce PowerLabs.Plug.Api.dll
2. Introduction of Catalogue
3. Call Method Myweather = new Weathermodel (Weatherxml.getweather ());
Return Json (Myweather), (need to introduce DLL in 1)
4, in Globla.cs
Private Static BOOLinited =false;//to add, control field Private Static ObjectInitlocker =New Object();//to add, the mutex locks protected voidApplication_Start () {//Initializing the weather if(inited = =false) { #regionInitializationLock(Initlocker)//The lock keyword marks a statement block as a critical section by obtaining a mutex for a given object, executing the statement, and then releasing the lock. { if(inited = =false) { //Start day ForecastWeatherxml.startweather (); //constant definition of timers for continuous weather acquisitionWeatherxml.init (); Inited=true; } } #endregion} arearegistration.registerallareas ();
5. Complete
Weather forecast Add