Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 897763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:56:01+00:00 2026-05-15T14:56:01+00:00

<script language=VB runat=server> Public Data As String = Public Height As Byte = 25

  • 0
<script language="VB" runat="server">
    Public Data As String = "" 
    Public Height As Byte = 25
    Public WidthMultiplier As Byte = 1

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim dictEncoding As StringDictionary
        Dim sbBarcodeImgs As StringBuilder

        Dim strEncodedData As String
        Dim I As Integer

        dictEncoding = New StringDictionary()
        dictEncoding.Add("0", "101001101101")
        dictEncoding.Add("1", "110100101011")
        dictEncoding.Add("2", "101100101011")
        dictEncoding.Add("3", "110110010101")
        dictEncoding.Add("4", "101001101011")
        dictEncoding.Add("5", "110100110101")
        dictEncoding.Add("6", "101100110101")
        dictEncoding.Add("7", "101001011011")
        dictEncoding.Add("8", "110100101101")
        dictEncoding.Add("9", "101100101101")
        dictEncoding.Add("A", "110101001011")
        dictEncoding.Add("B", "101101001011")
        dictEncoding.Add("C", "110110100101")
        dictEncoding.Add("D", "101011001011")
        dictEncoding.Add("E", "110101100101")
        dictEncoding.Add("F", "101101100101")
        dictEncoding.Add("G", "101010011011")
        dictEncoding.Add("H", "110101001101")
        dictEncoding.Add("I", "101101001101")
        dictEncoding.Add("J", "101011001101")
        dictEncoding.Add("K", "110101010011")
        dictEncoding.Add("L", "101101010011")
        dictEncoding.Add("M", "110110101001")
        dictEncoding.Add("N", "101011010011")
        dictEncoding.Add("O", "110101101001")
        dictEncoding.Add("P", "101101101001")
        dictEncoding.Add("Q", "101010110011")
        dictEncoding.Add("R", "110101011001")
        dictEncoding.Add("S", "101101011001")
        dictEncoding.Add("T", "101011011001")
        dictEncoding.Add("U", "110010101011")
        dictEncoding.Add("V", "100110101011")
        dictEncoding.Add("W", "110011010101")
        dictEncoding.Add("X", "100101101011")
        dictEncoding.Add("Y", "110010110101")
        dictEncoding.Add("Z", "100110110101")
        dictEncoding.Add("-", "100101011011")
        dictEncoding.Add(":", "110010101101")
        dictEncoding.Add(" ", "100110101101")
        dictEncoding.Add("$", "100100100101")
        dictEncoding.Add("/", "100100101001")
        dictEncoding.Add("+", "100101001001")
        dictEncoding.Add("%", "101001001001")
        dictEncoding.Add("*", "100101101101")


        strEncodedData = dictEncoding("*") & "0"
        For I = 1 To Len(Data)
            strEncodedData = strEncodedData & dictEncoding(Mid(Data, I, 1)) & "0"
        Next I
        strEncodedData = strEncodedData & dictEncoding("*")




        sbBarcodeImgs = New StringBuilder()
        For I = 1 To Len(strEncodedData)
            If Mid(strEncodedData, I, 1) = "1" Then
                sbBarcodeImgs.Append("<img src=""images/bar_blk.gif"" width=""" & WidthMultiplier & """ height=""" & Height & """ />")
            Else
                sbBarcodeImgs.Append("<img src=""images/bar_wht.gif"" width=""" & WidthMultiplier & """ height=""" & Height & """ />")
            End If
        Next I

        litBarcode.Text = sbBarcodeImgs.ToString
    End Sub
</script>
<asp:Literal ID="litBarcode" runat="server" />

Primarily the MID and dictionary usage are unfamiliar to me. Can this be completely converted to C#?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:56:02+00:00Added an answer on May 15, 2026 at 2:56 pm

    StringDictionary is just another collection class so no problem. Mid could still be used as Microsoft.VisualBasic.Mid() if you’re willing to import the Visual Basic library to your C# app (nothing bad about that) or it could be rewritten fairly easily.

    Edit: Actually, the VB.Net code just seems to use the Mid in the same way as you can use String.Substring so no need to use the Visual Basic library even. (I was thinking of Mid in VB6 that could be either a function or a statement, the function is similar to String.Substring but there’s no real easy way to replicate it if it’s the statement one but either way, doesn’t matter for this code).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code <html xmlns=http://www.w3.org/1999/xhtml> <head runat=server> <title></title> <script type=text/javascript src=<%= ResolveUrl(Scripts/jquery-1.3.2.min.js) %>></script>
I'm using script language ChaiScript with c++ and Qt. I've defined such function: void
Consider following script: SET LANGUAGE 'German' GO SET DATEFIRST 1 GO DECLARE @FullDate DATETIME
Does anybody have a PHP (or other language) script for drawing a spiral. A
What language and libraries are suitable for a script to parse and download small
I use this script to show an additional language menu additional, which works great
I begin in Python language and face a problem with my script. On stackoverflow,
I have some script in my default page that redirects users to language specific
I inherited a TCL script (I have zero familiarity with the language) and need
See example: <!DOCTYPE html> <html> <head> <title>language</title> <script type=text/javascript src=http://www.google.com/jsapi> </script> </head> <body> <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.