R
ryan.d.rembaum
Hello,
I have code that I wish to use in many web applications. Basically
sort of stand utility stuff. So from Visual Studio Project I select
add a component and chose Component Class. Lets say I enter code at
the end of this question in to the code section.
How then would I reference this in a new Web Application (or in the
same web application for that matter?)
I have tried:
<%@ Import Namespace="ByteArray.ByteArray" %>
and
<%@ Import Namespace="ByteArray" %>
But when I run the page it just gives me a message that the Namespace
can't be found.
Thanks,
Ryan
------------CODE FOLLOWS-----------------------------
Imports System.Globalization
Namespace ByteArray
Public Class ByteArray
Inherits System.ComponentModel.Component
|Component Designer generated code...|
Public Function CreateTypeByte(ByVal strInput As String) As
Byte()
Dim i As Integer
Dim arrChar As Char()
arrChar = strInput.ToCharArray()
Dim arrByte(arrChar.Length - 1) As Byte
For i = 0 To arrByte.Length - 1
arrByte(i) = Convert.ToByte(arrChar(i))
Next
Return arrByte
End Function
Public Function CreateTypeHex(ByVal strInput As String) As
Byte()
Dim i As Integer
Dim arrString As String()
arrString = strInput.Split(New Char() {"-"})
Dim arrByte(arrString.Length - 1) As Byte
For i = 0 To arrByte.Length - 1
arrByte(i) = Byte.Parse(arrString(i),
NumberStyles.HexNumber)
Next
Return arrByte
End Function
End Class
End Namespace
I have code that I wish to use in many web applications. Basically
sort of stand utility stuff. So from Visual Studio Project I select
add a component and chose Component Class. Lets say I enter code at
the end of this question in to the code section.
How then would I reference this in a new Web Application (or in the
same web application for that matter?)
I have tried:
<%@ Import Namespace="ByteArray.ByteArray" %>
and
<%@ Import Namespace="ByteArray" %>
But when I run the page it just gives me a message that the Namespace
can't be found.
Thanks,
Ryan
------------CODE FOLLOWS-----------------------------
Imports System.Globalization
Namespace ByteArray
Public Class ByteArray
Inherits System.ComponentModel.Component
|Component Designer generated code...|
Public Function CreateTypeByte(ByVal strInput As String) As
Byte()
Dim i As Integer
Dim arrChar As Char()
arrChar = strInput.ToCharArray()
Dim arrByte(arrChar.Length - 1) As Byte
For i = 0 To arrByte.Length - 1
arrByte(i) = Convert.ToByte(arrChar(i))
Next
Return arrByte
End Function
Public Function CreateTypeHex(ByVal strInput As String) As
Byte()
Dim i As Integer
Dim arrString As String()
arrString = strInput.Split(New Char() {"-"})
Dim arrByte(arrString.Length - 1) As Byte
For i = 0 To arrByte.Length - 1
arrByte(i) = Byte.Parse(arrString(i),
NumberStyles.HexNumber)
Next
Return arrByte
End Function
End Class
End Namespace