vb验证码制作求助
Private Sub CreateValidImage(ByVal checkCode As String)
Dim iWidth As Integer = checkCode.Length * 15
Dim image As New Bitmap(iWidth, 25) '图片大小
Dim g As Graphics = Graphics.fromImage(image)
g.Clear(Color.White)
Dim c As Color() = {Color.Black, Color.Red, Color.DarkBlue, Color.Green, Color.Red, Color.Brown, Color.DarkCyan, Color.Purple}
Dim font As String() = {"Verdana", "System", "Comic Sans MS", "Arial", "宋体"}
Dim rand As New Random()
Dim j As Short
For j = 0 To checkCode.Length - 1
Dim tmpPoint = New Point()
Dim cIndex As Short = rand.Next(8)
Dim fIndex As Short = rand.Next(5)
Dim f As New Font(font(fIndex), 12, FontStyle.Regular) '12磅,斜体)
Dim b As New SolidBrush(c(cIndex))
Dim dg = rand.Next(10, 50)
If (rand.Next(0, 2) = 0) Then
tmpPoint.x = 12
tmpPoint.y = -6
Else
dg = -dg + 1
tmpPoint.x = -10
tmpPoint.y = 6
End If
g.RotateTransform(dg)
相关问答:
我想把word另存为xml之后,用vb读取这个xml的内容,请问如何实现?
dim f as integer
dim b() as byte
dim s as string
dim L as long
f=freefile()
open "abc.xml" for binary access read as #f
......
把已有数据(数据大于20行)的RS(recordset)的第10行数据与第11行数据做加法后,删除第11行的数据,然后把后面的数据向前移。
RS的话修改数据是会更新数据库,现在的问题是RS里的已有数据是用SQL语句分类统计出来的 ......
Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' 打开刚创建的文件。
ReDim MyString(LOF(1) - 1)
Put #1, , MyRecord ' 读入所有字符到变量中 ......
怎么把已知的数据保存成xml文件,现在已知的数据是
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o=& ......
问题:
现在Access数据库中有两张表TableA和TableB
TableA中有记录如下:
字段1(Name) 字段2(Num)
A 3
A 4
B 6
... ......