¶¯Ì¬µ÷ÓÃWebService(C#)
ͨ³£ÎÒÃÇÔÚ³ÌÐòÖÐÐèÒªµ÷ÓÃWebServiceʱ£¬¶¼ÊÇͨ¹ý“Ìí¼ÓWebÒýÓÔ£¬ÈÃVS.NET»·¾³À´ÎªÎÒÃÇÉú³É·þÎñ´úÀí£¬È»ºóµ÷ÓöÔÓ¦µÄWeb·þÎñ¡£ÕâÑùÊÇʹ¹¤×÷¼òµ¥ÁË£¬µ«ÊÇÈ´ºÍÌṩWeb·þÎñµÄURL¡¢·½·¨Ãû¡¢²ÎÊý°ó¶¨ÔÚÒ»ÆðÁË£¬ÕâÊÇVS.NET×Ô¶¯ÎªÎÒÃÇÉú³ÉWeb·þÎñ´úÀíµÄÏÞÖÆ¡£Èç¹ûÄÄÒ»Ìì·¢²¼Web·þÎñµÄURL¸Ä±äÁË£¬ÔòÎÒÃÇÐèÒªÖØÐÂÈÃVS.NETÉú³É´úÀí£¬²¢ÖØбàÒë¡£ÔÚijЩÇé¿öÏ£¬Õâ¿ÉÄÜÊDz»ÄÜÈÌÊܵģ¬ÎÒÃÇÐèÒª¶¯Ì¬µ÷ÓÃWebServiceµÄÄÜÁ¦¡£±ÈÈçÎÒÃÇ¿ÉÒÔ°ÑWeb·þÎñµÄURL±£´æÔÚÅäÖÃÎļþÖУ¬ÕâÑù£¬µ±·þÎñURL¸Ä±äʱ£¬Ö»ÐèÒªÐÞ¸ÄÅäÖÃÎļþ¾Í¿ÉÒÔÁË¡£
˵ÁËÕâô¶à£¬Êµ¼ÊÉÏÎÒÃÇҪʵÏÖÕâÑùµÄ¹¦ÄÜ£º
public static object InvokeWebService(string url, string methodname, object[] args)
ÆäÖУ¬urlÊÇWeb·þÎñµÄµØÖ·£¬methodnameÊÇÒªµ÷Ó÷þÎñ·½·¨Ãû£¬argsÊÇÒªµ÷ÓÃWeb·þÎñËùÐèµÄ²ÎÊý£¬·µ»ØÖµ¾ÍÊÇweb·þÎñ·µ»ØµÄ½á¹ûÁË¡£
ҪʵÏÖÕâÑùµÄ¹¦ÄÜ£¬ÄãÐèÒªÕ⼸¸ö·½ÃæµÄ¼¼ÄÜ£º·´Éä¡¢CodeDom¡¢±à³ÌʹÓÃC#±àÒëÆ÷¡¢WebService¡£ÔÚÁ˽âÕâЩ֪ʶºó£¬¾Í¿ÉÒÔÈÝÒ×µÄʵÏÖweb·þÎñµÄ¶¯Ì¬µ÷ÓÃÁË£º
#region InvokeWebService
//¶¯Ì¬µ÷ÓÃweb·þÎñ
public static object InvokeWebService(string url, string methodname, object[] args)
{
return WebServiceHelper.InvokeWebService(url ,null ,methodname ,args) ;
}
public static object InvokeWebService(string url, string classname, string methodname, object[] args)
{
string @namespace = "EnterpriseServerBase.WebService.DynamicWebCalling" ;
if((classname == null) ||(classname == ""))
&nb
Ïà¹ØÎĵµ£º
2£©ÈçºÎ´´½¨Ò»¸öxmlÎĵµ
ÓÉÓÚxmlʵÖÊÒ²Ö»ÊÇÒ»¸öÎı¾Îļþ£¬ËùÒÔ×î¼òµ¥Äã¿ÉÒÔÖ±½ÓʹÓÃSystem.IOϵÄÀàÉú³ÉÒ»¸öÎļþ£¬²¢´æ´¢³ÉxmlÎļþ£¬µ±È»£¬ÄãÐèÒªÊÖ¶¯±£Ö¤¸ÃÎļþÐÎʽÁ¼ºÃ£¬±ÈÈç±ØÐëÓиùÔªËØ¡¢±ØÐëÓйرձêÇ©¡¢±ØÐëÕýȷǶÌ׵ȵȡ£
Èç¹ûÄãÀÁµÃ×Ô¼ºÈ¥ÏëÎļþµÄÐÎʽ£¬¿ÉÒÔʹÓÃSystem.XmlϵÄÀà¡£
Code
Xml ......
3£©¶ÁÈ¡¡¢²éÕÒ
µ±ÄãÊÖÍ·ÓÐÒ»¸öxmlÎļþºó£¬¿ÉÒÔʹÓÃXmlDocument.Load()·½·¨½«Æä¼ÓÔؽøÀ´ÒԱ㴦Àí£¬ËùÒÔ“¶ÁÈ¡”ûÓÐʲô¿É˵µÄ¡£¶ø“²éÕÒ”²Ù×÷ÍùÍùÉæ¼°XPath£¬ÕâÀïÖ»ÊÇÎÒÈÏΪµÄ±È½Ï³£Óõ½µÄ²éÕÒ²Ù×÷£¬XPathÕâÍæÒâʵÔÚÊǺÜÇ¿´óºÜ±©Á¦¡£
»ØÍ·¿´Ê¾ÀýÎĵµxmlsample.xml£¬ÎÒÃÇ¿ÉÄÜÓöµ½ÕâÑùµÄÐèÇó£ ......
RT¡£ÏÈÌù´úÂë
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Value_Ref_test1
{
class Program
{
static void Main(string[] args)
{
point a = new point (10,10) ;
point b = a;
......
1. ÃüÃû¹æ·¶
a) Àà
¡¾¹æÔò1-1¡¿Ê¹ÓÃPascal¹æÔòÃüÃûÀàÃû£¬¼´Ê××ÖĸҪ´óд¡£
¡¾¹æÔò1-2¡¿Ê¹ÓÃÄܹ»·´Ó³À๦ÄܵÄÃû´Ê»òÃû´Ê¶ÌÓïÃüÃûÀà¡£
¡¾¹æÔò1-3¡¿²»ÒªÊ¹ÓÓI”¡¢“C”¡¢“_”µÈÌض¨º¬Òåǰ׺¡£
¡¾¹æÔò1-4¡¿×Ô¶¨ÒåÒì³£ÀàÓ¦ÒÔException½áβ¡£
¡¾¹æÔò1-5¡¿ÎļþÃûÒªÄÜ·´Ó ......
±äÁ¿¡¢³£Á¿¼°±í´ïʽ±äÁ¿ºÍ³£Á¿±äÁ¿(¾²Ì¬¡¢·Ç¾²Ì¬¡¢Êý×éÔªËØ¡¢Öµ²ÎÊý¡¢ÒýÓòÎÊý¡¢Êä³ö²ÎÊý¡¢¾Ö²¿±äÁ¿)¾²Ì¬(static) Èç public static int x; Ò»µ©¾²Ì¬±äÁ¿ËùÊôµÄÀà±»×°ÔØ£¬Ö±µ½°üº¬¸ÃÀàµÄ³ÌÐòÔËÐнáÊøʱËüÒ»Ö±´æÔÚ¡£·Ç¾²Ì¬£º²»´øÓÐstaticÐÞÊηûÉùÃ÷µÄ±äÁ¿³ÆΪʵÀý±äÁ¿£¬Èçint a ;³£Á¿(attributes constnt-modifiers CO ......