Click here to Skip to main content
15,889,499 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionproblem with ado.net Pin
shahid hussain pakistan23-Nov-08 22:55
shahid hussain pakistan23-Nov-08 22:55 
AnswerRe: problem with ado.net Pin
Krazy Programmer23-Nov-08 23:13
Krazy Programmer23-Nov-08 23:13 
AnswerRe: problem with ado.net Pin
Christian Graus23-Nov-08 23:16
protectorChristian Graus23-Nov-08 23:16 
AnswerRe: problem with ado.net Pin
sumit703423-Nov-08 23:24
sumit703423-Nov-08 23:24 
AnswerRe: problem with ado.net Pin
Ashfield23-Nov-08 23:34
Ashfield23-Nov-08 23:34 
Questionhow to insert data from database into a table Pin
sram1523-Nov-08 22:32
sram1523-Nov-08 22:32 
Questionhow to use both dropdownlist and menu control with in masterpage Pin
sntkn23-Nov-08 22:14
sntkn23-Nov-08 22:14 
QuestionHow Create BarCode In ASP. net With C# . I Create Code In Asp.net With VB.net But I need ASP With C# [modified] Pin
IshtiaqueJ23-Nov-08 21:22
IshtiaqueJ23-Nov-08 21:22 
How Create Code Bar In ASP. net With C# .
I Create Code In Asp.net With VB.net But I need ASP With C#


I Send Code ASp.net With Vb.net BarCode

This Code Working Properly But I need In ASP.net With C#


-------------------------------------------------------------------------
---------------------------------------------------------------------------------------

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim Input As String = Request.QueryString("input")
Input = txtinput.Text
Dim ValidInput As String = " !" & Chr(34) & "#$%&()**+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" & Chr(0) & Chr(1) & Chr(2) & Chr(3) & Chr(4) & Chr(5) & Chr(6) & Chr(7) & Chr(8) & Chr(9) & Chr(10) & Chr(255)
Dim ValidCodes As String = "17401644163811761164110012241220112416081604157214361244123014841260125416501628161417641652190218681836183018921844184217521734159013041112109414161128112216721576157014641422113414961478114219101678158217681762177418801862181418961890181819141602193013281292120011581068106214241412123212181076107415541616197815561146134012121182150812681266195619401938175817821974140013101118151215061960195415021518188619661724168016926379"
Dim Digit As Integer = 103
Dim i As Integer
For i = 1 To Input.Length
Digit += (i * InStr(1, ValidInput, Mid(Input, i, 1)))
Next
Digit = Digit Mod 103
Input = Chr(8) & Input & Mid(ValidInput, Digit, 1) & Chr(255)
Dim bmp As Bitmap = New Bitmap((Input.Length * 11) + 13, 50)
Dim g As Graphics = Graphics.FromImage(bmp)
g.FillRectangle(New SolidBrush(Color.White), 0, 0, (Input.Length * 11) + 13, 50)
Dim p As New Pen(Color.Black, 1)
Dim BarValue, BarX As Integer
Dim BarSlice As Short
For i = 1 To Input.Length
Try
If InStr(1, ValidInput, Mid(Input, i, 1)) > 0 Then
BarValue = Val(Mid(ValidCodes, ((InStr(1, ValidInput, Mid(Input, i, 1)) - 1) * 4) + 1, 4))
Digit = 11
If i = Input.Length Then Digit = 13
For BarSlice = Digit To 0 Step -1
If BarValue >= 2 ^ BarSlice Then
g.DrawLine(p, BarX, 0, BarX, 50)
BarValue = BarValue - (2 ^ BarSlice)
End If
BarX += 1
Next
Else
Response.Write("Invalid input")
Response.End()
End If
Catch
End Try
Next




'bmp.Save(Response.OutputStream, ImageFormat.Gif)
bmp.Save("D:\WebSite6\Image\pic.gif", ImageFormat.Gif)
Image1.Visible = True




g.Dispose()
bmp.Dispose()
End Sub
---------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------

modified on Monday, November 24, 2008 4:47 AM

AnswerRe: How Create BarCode In ASP. net With C# . I Create Code In Asp.net With VB.net But I need ASP With C# Pin
BalasubramanianK23-Nov-08 22:26
BalasubramanianK23-Nov-08 22:26 
GeneralRe: How Create BarCode In ASP. net With C# . I Create Code In Asp.net With VB.net But I need ASP With C# Pin
IshtiaqueJ23-Nov-08 22:47
IshtiaqueJ23-Nov-08 22:47 
AnswerRe: How Create BarCode In ASP. net With C# . I Create Code In Asp.net With VB.net But I need ASP With C# Pin
Christian Graus23-Nov-08 22:52
protectorChristian Graus23-Nov-08 22:52 
QuestionHow can stop postback of calender in asp.net 2.0 Pin
vikramsc23-Nov-08 20:00
vikramsc23-Nov-08 20:00 
AnswerRe: How can stop postback of calender in asp.net 2.0 Pin
Abhijit Jana23-Nov-08 20:13
professionalAbhijit Jana23-Nov-08 20:13 
AnswerRe: How can stop postback of calender in asp.net 2.0 Pin
BalasubramanianK23-Nov-08 20:14
BalasubramanianK23-Nov-08 20:14 
GeneralRe: How can stop postback of calender in asp.net 2.0 Pin
N a v a n e e t h23-Nov-08 20:53
N a v a n e e t h23-Nov-08 20:53 
GeneralRe: How can stop postback of calender in asp.net 2.0 Pin
BalasubramanianK23-Nov-08 21:37
BalasubramanianK23-Nov-08 21:37 
GeneralRe: How can stop postback of calender in asp.net 2.0 Pin
Abhijit Jana23-Nov-08 21:42
professionalAbhijit Jana23-Nov-08 21:42 
AnswerRe: How can stop postback of calender in asp.net 2.0 Pin
Christian Graus23-Nov-08 20:48
protectorChristian Graus23-Nov-08 20:48 
AnswerRe: How can stop postback of calender in asp.net 2.0 Pin
Abhishek Sur23-Nov-08 20:54
professionalAbhishek Sur23-Nov-08 20:54 
Questionproblem with Excel Application Pin
vijaylumar23-Nov-08 19:53
vijaylumar23-Nov-08 19:53 
QuestionModification of file throwing error in sever...???.... Pin
subrat4all23-Nov-08 19:43
subrat4all23-Nov-08 19:43 
AnswerRe: Modification of file throwing error in sever...???.... Pin
Nishant Singh23-Nov-08 19:53
Nishant Singh23-Nov-08 19:53 
GeneralRe: Modification of file throwing error in sever...???.... Pin
subrat4all23-Nov-08 20:25
subrat4all23-Nov-08 20:25 
AnswerRe: Modification of file throwing error in sever...???.... Pin
Abhijit Jana23-Nov-08 20:31
professionalAbhijit Jana23-Nov-08 20:31 
GeneralRe: Modification of file throwing error in sever...???.... Pin
subrat4all23-Nov-08 20:34
subrat4all23-Nov-08 20:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.