Traditional Culture Encyclopedia - Weather forecast - Asp.net c # develops external WebService service and obtains data.
Asp.net c # develops external WebService service and obtains data.
Use? System. Assemble. Generics;
Use? System. Web
Use? System. Network service;
Namespace? test
{
///? & lt summary & gt
///? WebService? Summary description
///? & lt/summary & gt;
[WebService (namespace? =? " http://tempuri . org/"]
【WebServiceBinding(ConformsTo? =? WsiProfiles。 BasicProfile 1_ 1)]
[system. component model . toolbox item(false)]
Public? Class? WebService? :? System. network service
{
//Analog database
Private? Static electricity List & lt users & gt? User? =? New? List & lt users & gt ();
Static electricity Web service ()
{
//Initialize analog data
Users. Add (new? User ()? {? Data? =? Date and time. What about now? id? =? 1,? Baccino? =? "u 100 1", bar code? =? “c 12”,? Score? =? 95? });
Users. Add (new? User ()? {? Data? =? Date and time. Now. AddDays(- 1),? id? =? 1,? Baccino? =? "u 1002", bar code? =? “c 12”,? Score? =? 96? });
Users. Add (new? User ()? {? Data? =? Date and time. Now AddDays( 1),? id? =? 1,? Baccino? =? "u 1003", bar code? =? “c 12”,? Score? =? 97? });
Users. Add (new? User ()? {? Data? =? Date and time. What about now? id? =? 1,? Baccino? =? "u 1004", bar code? =? “c 12”,? Score? =? 98? });
Users. Add (new? User ()? {? Data? =? Date and time. What about now? id? =? 1,? Baccino? =? "u 1005", bar code? =? “c 13”,? Score? =? 99? });
Users. Add (new? User ()? {? Data? =? Date and time. What about now? id? =? 1,? Baccino? =? "u 1006", bar code? =? “c 13”,? Score? =? 100? });
}
[Network method]
Public? List & lt users & gt? Query (date and time? d 1,? Date and time? d2,? int? id,? String? batchNo,? String? Bar code)
{
List & lt users & gt? The result? =? null
What if? (! String. IsNullOrEmpty (bar code))
{
The result? =? Users. FindAll(f? = & gt? F.barcode.Equals (barcode));
}
other
{
What if? (! String. IsNullOrEmpty(batchNo))
{
The result? =? Users. FindAll(f? = & gt? f . batch no . equals(batch no));
}
other
{
The result? =? Users. FindAll(f? = & gt? f.id? ==? id? & amp& amp? f.data? & gt? d 1? & amp& amp? f.data? & lt? D2);
}
}
Return? Results;
}
}
Public? Class? user
{
Public? Date and time? Data? {? get? Settings; ? }
Public? int? id? {? get? Settings; ? }
Public? String? Baccino? {? get? Settings; ? }
Public? String? Bar code? {? get? Settings; ? }
Public? int? Score? {? get? Settings; ? }
}
}
- Previous article:Travel to Heihe River? This is a good season to travel to Heihe River.
- Next article:About Huangshan Mountain
- Related articles
- What clothes will Yunnan wear in mid-April?
- Does freckle cream really work? Which brand of freckle cream works well?
- What are the precautions for traveling to Hong Kong and Macao?
- Where is the best place to soak in hot springs in Zibo?
- The weather in Tai 'an these two days, I want to climb Mount Tai, I don't know if it's suitable or not.
- What should I do if the computer host is very hot?
- The desert is flooding and the earth is "cooling down"? Is the winter warning coming? 202 1 Great climate change?
- Which scenic spots in Xinjiang are suitable for autumn?
- Sentences (generally 80 sentences) to remind boyfriend of heatstroke prevention at high temperature.
- What is the relationship between weather change and rainstorm in Hubei?