[HELP] Need help with code. REWARD

Posts 1–15 of 15 · Page 1 of 1
[HELP] Need help with code. REWARD
So i need help with a code, but before i start, the reward is to be in the credits of my program which has currently 4,353 lines of code (not lying). Plus ill give you the program that I have created right now (not everything works, but still useful). And its gonna be released within the next couple of weeks. So heres the code i need help with:
Code:
Dim source As String
Dim fileURL As String = ".rez"
Dim dir As String = TextBox1.Text
If CheckedListBox1.CheckedItems.Contains("ATTACH_M") Then
            Dim filename As String = "ATTACH_M"
            source = "http://deadskulz.x.gg/rezdownloader/" + filename + fileURL
            Try
                'My.Computer.Network.DownloadFile((source), (dir) + "\" + filename + fileURL)
                httpclient.DownloadFileAsync(New Uri(source), (dir) + "\" + filename + fileURL)
            Catch ex As Exception
                MsgBox("failed")
            End Try

            stage = stage + 1
            stagelabel.Text = stage + "/" + CheckedListBox1.CheckedItems.Count.ToString
        End If
So what happends is a error shows up with this as the message:
Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.FormatException: Input string was not in a correct format.
   at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
   at Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
Deadskulz UserApp
    Assembly Version: 1.0.0.6
    Win32 Version: 1.0.0.6
    CodeBase: file:///C:/Users/Max/Documents/Visual%20Studio%202008/Projects/AutoUpdater2/AutoUpdater2/bin/Release/Deadskulz%20UserApp.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
BUT the file actually does download, so, does anyone know whats wrong?
So if you want even more info on the error, please email me at: bushouse92@gmail.com and we can do a TV session on it.
Code:
 Dim filename As String = "ATTACH_M"
            source = "http://deadskulz.x.gg/rezdownloader/" + filename + fileURL
            Try
                'My.Computer.Network.DownloadFile((source), (dir) + "\" + filename + fileURL)
                httpclient.DownloadFileAsync(New Uri(source), (dir) + "\" + filename + fileURL)
            
            stage = stage + 1
            stagelabel.Text = stage + "/" + CheckedListBox1.CheckedItems.Count.ToString
      Catch ex As Exception
                MsgBox(ex)
            End Try
Write down the error, if the program does download and does not close using the try-catch block I've posted you may just remove the messagebox.
when I tried out your way, the forum of the rez downloader didnt even work, theres an error that said 'could nout create system forum.'

heres the error after i fixed the forum to show up, this occurs in visual basic, when I press download, but It does download, after about 20 sec of the error appearing. with the httpclient method.



and heres the error when I launch it without visual basic:

Quote Originally Posted by deadskulz View Post
when I tried out your way, the forum of the rez downloader didnt even work, theres an error that said 'could nout create system forum.'

heres the error after i fixed the forum to show up, this occurs in visual basic, when I press download, but It does download, after about 20 sec of the error appearing. with the httpclient method.



and heres the error when I launch it without visual basic:

This info is not helpful. At least the stack trace is needed. You need to post the code of the form. Right now I can suggest that you add a Try..Catch...wrapper around inside every procedure in the form that's showing the exception.

For example if the name of the form is "FrmDownloader", then its load event should look something like this:

Private Sub FrmDownloader_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Try

'Your code here...

Catch ex As Exception

End Try


End Sub

Do the same with every procedure and hopefully the problem would be solved. If not, then show us some code.
ok.. yeah, i 4got bout that, well i fixed one way, the
Code:
My.Computer.Network.DownloadFile(source, dirURL)
way.

But I want to do the httpclient way, so heres part of the coding in the rezdownloader that deals with the error.
Code:
Dim source As String
    Dim totalsize As String
    Dim fileURL As String = ".rez"
    Dim dirURL As String
    Dim filename As String
    Dim dir As String = TextBox1.Text
    Dim stage As String = 0
    Dim baseurl As String = "http://deadskulz.x.gg/rezdownloader/"
    Private WithEvents httpclient As WebClient

    Private Sub download_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles download.Click
        httpclient = New WebClient
        source = "http://deadskulz.x.gg/rezdownloader/" + filename + fileURL
        stagelabel.Text = stage + "/" + CheckedListBox1.CheckedItems.Count.ToString
        'httpclient.DownloadFileAsync(New Uri(source), (dirURL))
        If CheckedListBox1.CheckedItems.Contains("ATTACH_M") Then
            filename = CheckedListBox1.CheckedItems.ToString
            source = baseurl + +filename + fileURL
            dirURL = (dir) + "\" + filename + fileURL
            Try
                NotifyIcon1.Visible = True
                My.Computer.Network.DownloadFile(source, dirURL)
                stage = stage + 1
                stagelabel.Text = stage + "/" + CheckedListBox1.CheckedItems.Count.ToString
            Catch ex As Exception
                MsgBox("Failed.")
            End Try
        End If
    End Sub
Code:
Try  
httpclient = New WebClient
        source = "http://deadskulz.x.gg/rezdownloader/" + filename + fileURL
        stagelabel.Text = stage + "/" + CheckedListBox1.CheckedItems.Count.ToString
        'httpclient.DownloadFileAsync(New Uri(source), (dirURL))
        If CheckedListBox1.CheckedItems.Contains("ATTACH_M") Then
            filename = CheckedListBox1.CheckedItems.ToString
            source = baseurl + +filename + fileURL
            dirURL = (dir) + "\" + filename + fileURL
            
                NotifyIcon1.Visible = True
                My.Computer.Network.DownloadFile(source, dirURL)
                stage = stage + 1
                stagelabel.Text = stage + "/" + CheckedListBox1.CheckedItems.Count.ToString
            Catch ex As Exception
                MsgBox("Failed.")
            End Try
        End If
That neither works?
It cant, theres no "try".
There is, duh. Just in the first line.
God, ok, well i dont need help with the 'my.network.downloadfile(source, dir)' method, i need help with the httpclient method, bc i already got the first one working from bombsway.
Well the code above should actually prevent your program from dying.
yeah, but im just saying that i figured out how to do the 'my.network' way of downloading things, but since thats slow, i would like to figure out whats wrong with the httpclient was, because the error that keeps on coming up says 'input string not in correct format'.
Quote Originally Posted by deadskulz View Post
yeah, but im just saying that i figured out how to do the 'my.network' way of downloading things, but since thats slow, i would like to figure out whats wrong with the httpclient was, because the error that keeps on coming up says 'input string not in correct format'.
Did you just want my downloader source from my .rez downloader? I won't send you my full source, but I don't mind sharing the source to download a file.
sure, does it use http or 'my.network'?
Quote Originally Posted by deadskulz View Post
sure, does it use http or 'my.network'?
http. I'll copy and paste it to you via PM in a sec.
kk, thank you sooo much
Posts 1–15 of 15 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us