vb ÖÐ - VB / »ù´¡Àà
dim a as string,b as string£¬c as string
a="¹¤³Ì±àºÅ,µ¥Î»¹¤³ÌÃû³Æ,·Ö²¿¹¤³Ì±àºÅ"
b="µ¥Î»¹¤³ÌÃû³Æ"
c="µ¥Î»"
Ôõô²ÅÄÜÅжϳöa×Ö·û´®ÖдæÔÚb×Ö·û´®£¬¶ø²»´æÔÚc×Ö·û´®
¿´¿´instr
»Ø¸´ÄÚÈÝÌ«¶ÌÁË£¡»Ø¸´ÄÚÈÝÌ«¶ÌÁË£¡»Ø¸´ÄÚÈÝÌ«¶ÌÁË£¡»Ø¸´ÄÚÈÝÌ«¶ÌÁË£¡
Ï£Íû×îºÃÓоßÌå´úÂë £¬±¾ÈËÊÇÐÂÊÖ£¬Ð»Ð»
Äã˵µÄ¡®´æÔÚb×Ö·û´®£¬¶ø²»´æÔÚc×Ö·û´®¡¯
ÊÇÈ«²¿»¹ÊDz¿·Ö£¿
if instr(a,b)<>0 and instr(a,c)=0 then
'aÖаüÀ¨bµ«²»°üÀ¨c
end if
if instr(a,b) and instr(a,c)=0 then
'....
end if
ÎÒµÄa¡¢bºÍc¶¼ÊDz»¹Ì¶¨µÄ£¬ÎÒÉÏÃæ¸ø³öµÄÖ»ÊÇÁгöµÄÒ»¸öÀý×Ó
instrº¯Êý
»òÕßÓÃsplitº¯Êý½«a×Ö·û´®°´ÕÕ¡°£¬¡±·ÖÀ뿪À´£¬È»ºóÅжÏ×Ö·û´®ÊÇ·ñÏàµÈ
×îºÃÊÇinstrº¯ÊýÁË
VB code:
Option Explicit
Function StringComp(ByVal s As String, sFind1 As String, sFind2 As String) As Long
'µÚÒ»¸ö´æÔÚ·µ»Ø1,µÚ¶þ¸ö´æÔÚ·µ»Ø2,¶þ¸ö¶¼´æÔÚ·µ»Ø3,¶þ¸ö¶¼²»´æÔÚ,·µ»Ø0
Const SEPARATOR = ","
s = SEPARATOR & s & SEPARATOR
sFind1 = SEPARATOR & sFind1 & SEPARATOR
sFind2 = SEPARATOR & sFind2 & SEPARATOR
StringComp = -(InStr(s, sFind1) > 0) + -2 * (InStr(s, sFind2) > 0)
End Function
Private Sub Command1_Click()
Dim a As String, b As String, c As String
a = "¹¤³Ì±àºÅ,µ
Ïà¹ØÎÊ´ð£º
vbÊDz»ÊǺÜÅ£°¡ ÔõôÄÇô¶àµÄ²¡¶¾¶¼ÊÇvb×öµÄ°¡ c#Ðв»ÐУ¿
c#ÔÚXPÔËÐв»ÁË£¬³ý·ÇÈñðÈËÏÈ×°ÉÏ.net.
VBÏà¶ÔÓÚC,C++,ASMµÈµÈ£¬¾ÖÏÞÐÔ´ó¶àÁË¡£
±ðÔÙ˵ʲôÓïÑÔ²»ÈçʲôÓïÑԵĻ°ÁË£¬Ö»ÓÐÄã²»»áÓûòÓÃ×Ų»Ë³ÊÖµÄÓ ......
¿ÉÒÔÂð
ºÃÆæ¹ÖµÄÌâÄ¿¶î£¡£¡
¿ÉÒÔ¸æËßÎÒÃÇÄãµ½µ×ÏëÎÊʲô £¿
2·Ö¸øÎҵĻ°¾Í¿ÉÒÔ¡£
........................¿ÉÒÔÂð
¿ÉÒÔ!
¾À½á£¬
29. vb¿ÉÒÔÕâÑù×ö²»£¿ ( H )¡Ì
A. ......
ÏÖÔÚÓиöxmlÎļþÊÇ<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
xmlDoc1.loadXML(h)×ÜÊÇ·µ»Øfalse£¬ÎªÊ²Ã´£¿Ð»Ð»°ïæ»Ø´ðÒ»ÏÂ
hÊÇʲôÄØ¡£¡£¡£¡£¡£¡£¡£¡£¡£
hÊÇxml¸ñʽµÄ×Ö·û´®
ÄãÊÇÏë´ò¿ª¡£XML¸ñʽµÄÎļþ°É£¿
ÎÒÊÇ°Ñh·ÅÔÚxmlDoc1ÀÓÃxmlDoc1.loadXML(h)£¬È»ºóÈ¡xmlDo ......