大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
Dim s As String = "123124" vbTab "213131" vbTab "123123" vbTab "131312"
房山ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联公司的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!
Dim arr As String() = s.Split(vbTab) '放入arr数组
For i As Integer = 0 To UBound(arr)
Console.WriteLine(arr(i))
Next
不需要用数组:
假设已经存在的图片文件存放在 C:\图片 文件夹里,并假设新创建的文件夹位于C:\图片 文件夹里。
在窗体上添加一个按钮,代码如下:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n As Long = -1
Dim P As Long = -1
Dim Pn As String
Dim MyNum As Integer = 100 '每100个文件存放在一个文件夹里
Dim MyPath As String
Dim MyFileName As String
Button1.Enabled = False
MyPath = "C:\图片\" '指定已有图片的路径
MyFileName = UCase(Dir(MyPath, FileAttribute.Normal)) ' 找寻第一项。
Do While MyFileName "" ' 开始循环。
If InStr(MyFileName, "JPG") 0 Or InStr(MyFileName, "GIF") 0 Or InStr(MyFileName, "PNG") 0 Then
n = n + 1
If n \ MyNum P Then
P = P + 1
Pn = CStr(n \ MyNum + 1)
MkDir(MyPath Pn)
End If
FileCopy(MyPath MyFileName, MyPath Pn "\" MyFileName)
End If
MyFileName = UCase(Dir()) ' 查找下一项
Loop
Button1.Enabled = True
End Sub
代码通过测试。
Dim str0 As String, idx As Long, str1 As String, str2 As String
str0 = "122012312}R4561_456}7894321}1234123123}"
idx = str0.IndexOf("}")
Do While idx = 0
str1 = str0.Substring(0, idx)
str2 = str0.Substring(idx + 1)
'在文本框中添加显示str1、str2,代码略
str0 = str2
idx = str0.IndexOf("}")
Loop