Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Code as a DLL or Control?

Avatar of Zoooink
Zoooink asked on
Visual Basic Classic.NET ProgrammingVisual Basic.NET
3 Comments1 Solution186 ViewsLast Modified:
Hi Experts,

Now I'm not sure if this is possible, but I'd like to convert the following code into either a control, or a DLL. The code below currently sits in a menuitem procedure which when clicked, takes data stored in a text file and sends it to a pre-defined web page.

What I need is to have the text elements of the code i.e msgbox text, configurble as part of a control with properties to set or as a configurable DLL if there is such a thing? The most important part though is the web request create, Ideally I want it so that I can enter a number in a control poroperty and the code creates the temp variables?

ProgressBar1.Visible = True
        ProgressBar1.Value = 10
        Try
            If File.Exists(strAppDir & "\import.txt") = True Then
 
                Dim fsa As New FileStream(strAppDir & "\import.txt", FileMode.Open, FileAccess.Read)
                'declaring a FileStream to open the file named import.txt with access mode of reading
                Dim da As New StreamReader(fsa)
                da.BaseStream.Seek(0, SeekOrigin.Begin)
 
                Dim tempa As String
 
                'Send the data to the script
                Do While da.Peek() > -1
                    Dim temp As String()
                    tempa = da.ReadLine
 
                    Dim fl As Int16 = 0
                    Dim i2 As Int16 = 0
 
                    temp = tempa.Split(" ")
 
                    Dim req As WebRequest = WebRequest.Create(script & "?1=" & temp(0) & "&2=" & temp(1) & "&3=" & temp(2) & "&4=" & temp(3) & "&5=" & temp(4) & "&6=" & temp(5) & "&7=" & temp(6) & "&8=" & temp(7) & "&9=" & temp(8) & "&10=" & temp(9) & "&11=" & temp(10) & "&12=" & temp(11) & "&13=" & temp(12) & "&14=" & temp(13) & "&15=" & temp(14) & "&16=" & temp(15) & "&17=" & temp(16) & "&18=" & temp(17) & "&19=" & temp(18) & "&20=" & temp(19) & "&21=" & temp(20) & "&22=" & temp(21) & "&23=" & temp(22) & "&24=" & temp(23) & "&25=" & temp(24) & "&26=" & temp(25) & "&27=" & temp(26) & "&28=" & temp(27) & "&29=" & temp(28) & "&30=" & temp(29) & "&31=" & temp(30) & "&32=" & temp(31) & "&33=" & temp(32) & "&34=" & temp(33) & "&35=" & temp(34) & "&36=" & temp(35) & "&37=" & temp(36) & "&38=" & temp(37) & "&39=" & temp(38) & "&40=" & temp(39) & "&41=" & temp(40) & "&42=" & temp(41) & "&43=" & temp(42) & "&44=" & temp(43) & "&45=" & temp(44) & "&46=" & temp(45) & "&47=" & temp(46) & "&48=" & temp(47) & "&49=" & temp(48) & "&50=" & temp(49) & "&51=" & temp(50) & "&52=" & temp(51) & "&53=" & temp(52) & "&54=" & temp(53) & "&55=" & temp(54) & "&56=" & temp(55) & "&57=" & temp(56) & "&58=" & temp(57) & "&59=" & temp(58) & "&60=" & temp(59) & "&61=" & temp(60) & "&62=" & temp(61) & "&63=" & temp(62) & "&64=" & temp(63) & "&65=" & temp(64) & "&66=" & temp(65) & "&67=" & temp(66))
                    Dim resp As WebResponse = req.GetResponse()
                    resp.Close()
 
                Loop
                ProgressBar1.Value = 100
                da.Close()
                File.Delete(strAppDir & "\import.txt")
                ProgressBar1.Value = 0
                ProgressBar1.Visible = False
                MsgBox("Data transmission successful.", MsgBoxStyle.OkOnly, "Project MFD")
            End If
 
        Catch ex As IndexOutOfRangeException
            MsgBox("An unauthorised manual modification of the transmission data has occurred, please contact support for assistance.", MsgBoxStyle.OkOnly, "Project MFD Error")
 
        Catch ex As Exception
            MsgBox("One of the following errors has occurred:" & (Chr(13)) & (Chr(13)) & "1. MDA signal is weak. (Perform soft reset with the stylus, move to a better area, try again)" & (Chr(13)) & (Chr(13)) & "2. MDA transmitter is switched off. (Call support)", MsgBoxStyle.OkOnly, "Project MFD Transmission Error")
            ProgressBar1.Value = 0
            ProgressBar1.Visible = False
 
        End Try
ASKER CERTIFIED SOLUTION
Avatar of JackOfPH
JackOfPHFlag of Philippines image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answers