|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: |
Private Function GenerateVCodeImage() As String
Dim bmfile As String = Server.MapPath("~") & "\capimage.jpg"
Dim txfile As String = Server.MapPath("~") & "\captext.txt"
Dim oBitmap As Drawing.Bitmap = New Drawing.Bitmap(90, 35)
Dim oGraphic As Drawing.Graphics = Drawing.Graphics.FromImage(oBitmap)
Dim foreColor As System.Drawing.Color
Dim backColor As System.Drawing.Color
Dim sText As String = generateVCode(5)
Dim sFont As String = "Comic Sans MS"
foreColor = System.Drawing.Color.FromArgb(220, 220, 220)
backColor = System.Drawing.Color.FromArgb(190, 190, 190)
Dim oBrush As New Drawing.Drawing2D.HatchBrush(CType(generateHatchStyle(), Drawing.Drawing2D.HatchStyle), foreColor, backColor)
Dim oBrushWrite As New Drawing.SolidBrush(Drawing.Color.Red)
oGraphic.FillRectangle(oBrush, 0, 0, 100, 50)
oGraphic.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
Dim oFont As New Drawing.Font(sFont, 14)
Dim oPoint As New Drawing.PointF(5.0F, 4.0F)
oGraphic.DrawString(sText, oFont, oBrushWrite, oPoint)
Response.ContentType = "image/jpeg"
oBitmap.Save(bmfile, Drawing.Imaging.ImageFormat.Jpeg)
oBitmap.Dispose()
verimg.ImageUrl = "capimage.jpg"
File.WriteAllText(txfile, sText)
Return sText
End Function
Private Function generateVCode(ByVal CodeLength As Integer) As String
Dim VCode As String = String.Empty
Dim randObj As New Random()
Dim c As Integer = 63
For i As Byte = 1 To CodeLength
c = randObj.Next(35)
If c >= 10 Then
c += 7
End If
c += 48
VCode += Chr(c)
Next
Return VCode
End Function
Private Function generateHatchStyle() As HatchStyle
Dim slist As New ArrayList
For Each style As HatchStyle In System.Enum.GetValues(GetType(HatchStyle))
slist.Add(style)
Next
Dim randObj As New Random()
Dim index As Integer = randObj.Next(slist.Count - 1)
Return CType(slist(index), HatchStyle)
End Function
|
Advertisement
| Hall of Fame |