ʹÓÃc#¿ª·¢mapserverÖ®ÁùstyleObj
styleObjÓÃÓÚÉèÖÃͼ²ãµÄ·ûºÅ¡£ËüÔÚclassObjÖж¨Ò壬һ°ãÓÚsymbolObjÒ»ÆðʹÓá£Í¨¹ýÉèÖÃstyleObj£¬¿ÉÒÔ²úÉúǧ±äÍò»¯£¬·á¸»¶à²ÊµÄµØÍ¼¡£
Ò»¸ö¼òµ¥µÄstyleObjʾÀý£º
CLASS
NAME "Primary Roads"
STYLE
SYMBOL "circle"
COLOR 178 114 1
SIZE 15
END #style1
STYLE
SYMBOL "circle"
COLOR 254 161 0
SIZE 7
END #style2
END
´ÓÒÔÉÏʾÀý¿ÉÒÔ¿´³ö£¬ÔÚCLASS¶ÔÏóÖаüº¬ÁËÁ½¸öSTYLE¶ÔÏó£¬Ã¿¸öSTYLE¶ÔÏó´ú±íÁËÒ»¸ö·ûºÅ£¬Á½¸öSTYLE¶ÔÏóµþ¼Ó¿ÉÒÔ²úÉúÒ»¸ö¸´ºÏ·ûºÅ£º¾ßÓÐÁ½ÖÖÑÕÉ«µÄµÀ·Ïß¡£
Ч¹ûÈçÏÂͼ£¬STYLEÒ»¿í¶ÈΪ15ÏñËØ£¬Î»Óڵײ㣬STYLE¶þ¿í¶È7ÏñËØ£¬Î»ÓÚÉϲ㣬ÐγÉÒ»Ìõ¸´ºÏÏߣº
ͨ¹ý¶à¸östyleµþ¼ÓµÄ·½Ê½£¬¿ÉÒÔʵÏÖ¶àÖÖ¸´ÔӵķûºÅЧ¹û¡£
ÔÚcsharp_mapscriptÖпÉÒÔ·½±ãµÄÐÞ¸Äͼ²ãµÄ·ûºÅÒÔ¼°¶¯Ì¬Éú³É·ûºÅ£¬ÈçÏÂÓм¸¶ÎʾÀý³£ÓôúÂ룺
//´´½¨Ò»¸östyleObj¶ÔÏó
styleObj pStyle = new styleObj(null);
//ÔÚclass¶ÔÏóÖд´½¨Ò»¸östyleObj¶ÔÏó
styleObj pStyle = new styleObj(pLayerObj.getClass(0));
//´Óclass¶ÔÏóÖлñȡһ¸östyleObj¶ÔÏó
styleObj pStyle = m_ pLayerObj.getClass(0).getStyle(0);
ͨ¹ýÒÔÉϵĴúÂë¶¼¿ÉÒÔ»ñµÃÒ»¸östyle¶ÔÏó£¬Í¨¹ýÐÞ¸Ästyle¶ÔÏ󣬿ÉÒÔÉèÖø÷ÖÖ²ÎÊýÀ´Éú³É²»Í¬µÄµØÍ¼·ûºÅ£¬Í¨³£ÐèÒªÅäºÏsymbol¶ÔÏóʹÓá£
styleObj pStyle = new styleObj(pClassObj);
//ÉèÖÃsymbol¶ÔÏó
pStyle.setSymbolByName(pMapObj, “symbolname”);
//ÉèÖ÷ûºÅµÄÑÕÉ«
pStyle.color = new colorObj(100, 100, 100, 0);
//ÉèÖ÷ûºÅµÄ³ß´ç´óС
pStyle.size = 8;
//ÉèÖ÷ûºÅµÄ±ßÏß¿í¶È£¬¶ÔµãºÍÏß·ûºÅÓÐЧ
pStyle.outlinewidth = 1;
//ÉèÖ÷ûºÅµÄ±ßÏßÑÕÉ«£¬¶ÔµãºÍÏß·ûºÅÓÐЧ
pStyle.outlinecolor = new colorObj(0, 0, 0, 0);
Ïà¹ØÎĵµ£º
C:\ProgramFiles\MicrosoftVisual Studio .NET\ FrameworkSDK\Samples\ Technologies\ Interop\PlatformInvoke\ WinAPIs\CSĿ¼ÏÂÓдóÁ¿µÄµ÷ÓÃAPIµÄÀý×Ó¡£
Ò»¡¢µ÷Óøñʽ
using System.Runtime.InteropServices; //ÒýÓôËÃû³Æ¿Õ¼ä£¬¼ò»¯ºóÃæµÄ´úÂë
//ʹÓÃDllImportAttributeÌØÐÔÀ´ÒýÈëapiº¯Êý£¬×¢ÒâÉùÃ÷µÄÊǿշ½·¨£¬¼´·½· ......
¶ÔÓÚ¶à̬£¬»¹±ØÐèÌáÒ»¸öC#ÖеĹؼü×Ö£ºnew¡£Ç°ÃæÌáµ½£¬¶ÔÓÚvirtual·½·¨£¬JIT»áÈ·¶¨ÊµÀýµÄʵ¼ÊÀàÐÍÈ»ºó¾ö¶¨µ÷ÓÃʲô·½·¨¡£µ«ÊÇÈç¹ûÅÉÉúÀàÖÐnew¹Ø¼ü×ÖÐÞÊη½·¨£¬ÔòËüÏòCLR³ÎÇå´ËÅÉÉúÀàÖеķ½·¨Óë»ùÀàÖеķ½·¨ºÁÎÞ¹ØÏµ£¬ÒÔÏ´úÂë×îÖÕµ÷ÓÃÊÇ»ùÀàµÄintroduce·½·¨£º
Code
class Program
{
static vo ......
ÊÖ»úÒôÀÖ²¥·¢Æ÷ÀïÓÐ×ÜÎļþ×Üʱ¼äµÄͳ¼Æ£¬ÔÚ¿á¹·²¥·ÅÆ÷ÀïÕÒÁËÒ»ÏÂûÕÒµ½¡£ÄÇÎÒÏëÖªµÀÕâЩ¸èÇúµÄ×Üʱ¼ä£¬¸ÃÔõô°ì£¿
ÆäʵºÜ¼òµ¥£¬ÉÔÉÔ¶¯¶¯ÊÖ£¬¾ÍÄÜÕÒµ½´ð°¸£¡
Çë²Î¿¼Èçϲ½Ö裺
µÚÒ»²½£¬±£´æ²¥·ÅÁÐ±í£¬°ÑÀïÃæµÄ¸èÇú±£´æµ½Ò»¸öÄãϲ»¶µÄÃû×Ö¡£
µÚ¶þ²½£¬ÔÚ²¥·ÅÁбíÉÏÃæµãÓÒ¼ü£¬µ½´¦²¥·ÅÁÐ±íµ½ÄãÕҵĵ½µÄµØ·½¡£
¾²âÊÔ£¬×îР......
ÊôÐÔÊÇÀàÖпÉÒÔÏñÀàµÄ×Ö¶ÎÒ»Ñù·ÃÎʵķ½·¨¡£ÊôÐÔ¿ÉÒÔΪÀàµÄ×Ö¶ÎÌṩ±£»¤£¬±ÜÃâ×Ö¶ÎÔÚ¶ÔÏó²»ÖªµÀÇé¿öϱ»Ð޸ġ£C#ͨ¹ýÊôÐÔÀ´Ð޸쬶Áд»ò¼ÆËã˽ÓеÄ×ֶεÄÖµ¡£ÊôÐÔÏ൱ÓÚ¶Ô×ֶηÃÎʵķâ×°¡£ÏÂÀý×Ó¿ÉÒÔÇå³þ˵Ã÷Ó´£º
class Person
{
......
//Socket»ù±¾±à³Ì
//·þÎñ¶Ë£º
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
Thread mythread ;
Socket socket;
// ÇåÀíËùÓÐÕýÔÚʹÓõÄ×ÊÔ´¡£
protected override void Dispose( bool disposing )
{
try
¡¡ { ¡¡¡¡
¡¡¡¡ socket.Close();//ÊÍ·Å×ÊÔ´
......