用 Like
创新互联建站2013年至今,是专业互联网技术服务公司,拥有项目成都网站设计、网站制作网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元二连浩特做网站,已为上家服务,为二连浩特各地企业和个人服务,联系电话:18980820575
% = 任意数量的字符
?= 单个字符
类似简易的正规则比对。
具体可参照MSDN
例:(以下代码可以直接放到程序里执行)
dim str as string
str = "abc123"
if str like "a%" then msgbox "yes"
if str like "%a%2%" then msgbox "yes"
if str like "%3" then msgbox "yes"
if str like "%3?" = false then msgbox "no"
vb.net规定如果要比较字符串,不能用“=”,strcomp(str1,str2,n)或者string.compare(str1,str2)
例如:
Dim a As String = "c"
Dim b As String = "c"
Dim n As Integer = String.Compare(a, b)
If n = 0 Then
MsgBox("=")
Else
MsgBox("")
End If
用不到2个命令按钮 1个就够
在按钮的过程中写如下代码
dim x as long , y as long ,z as long ,j as long ,n as long
dim k as integer
x = val(text1.text)
y = val(text2.text)
z = val(text3.text)
j = val(text4.text)
if x = then k = k+1
if y= then k = k+1
if z= then k = k+1
if j= then k = k+1
' 若输入的数有负数 则必须先在这里写下 n=-.....()
do
if x 0 and n = x then
text5.text = text5.text " " x
k = k +1
end if
if y 0 and n = then
text5.text = text5.text " " y
k = k +1
end if
if z 0 and n = z then
text5.text = text5.text " " z
k = k +1
end if
if j 0 and n = j then
text5.text = text.text " " j
k = k +1
end if
if k = 4 then exit for
n=n+1
loop
这是VB的代码。。。。 不知道.net 适用不
If System.IO.File.ReadAllBytes(文件名1).SequenceEqual(System.IO.File.ReadAllBytes(文件名2)) Then
相等
Else
不相等
End If
N=length(R);
scatter(C(:,1),C(:,2));
hold on
plot([C(R(1),1),C(R(N),1)],[C(R(1),2),C(R(N),2)])
hold on
for ii=2:N
plot([C(R(ii-1),1),C(R(ii),1)],[C(R(ii-1),2),C(R(ii),2)])
hold on
end