Results 1 to 11 of 11
  1. #1
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused

    [Help] Debugging Errors



    Not sure what the cause of this is. Let me know if there are any ideas to solve the issue.

    Should I ignore it? Or... What? Dx


    Also, the application crashes on other pc's :/


    [php]Public Class Form1
    Public Function searchDir(ByVal path As String) As List(Of String)
    Dim paths As New Stack(Of String)
    Dim files As New List(Of String)

    paths.Push(path)

    While paths.Count > 0
    Dim dir As String = paths.Pop

    Try
    files.AddRange(IO.Directory.GetFiles(dir))
    Catch ex As Exception
    End Try

    Try
    For Each s As String In IO.Directory.GetDirectories(dir)
    paths.Push(s)
    Next
    Catch ex As Exception
    End Try
    End While
    Return files
    End Function
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If ListBox1.Tex*****ntains("") Then
    ButtonX2.Enabled = False
    End If
    End Sub
    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
    For Each file As String In searchDir(ComboBox1.Text + ":/Windows/Prefetch")
    ListBox1.Items.Add(file)
    Next
    If ListBox1.Tex*****ntains("") Then
    Label1.Text = ("Select the drive that Windows is installed on")
    End If
    Label1.Text = ("Gathered prefetch folder contents. Please click 'Clear Prefetch' to finish.")
    If ListBox1.Tex*****ntains("") Then
    MsgBox("Either Windows is not installed on the selected drive" & vbNewLine & "or the prefetch folder is already cleared.")
    End If
    End Sub

    Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
    For Each f As String In searchDir(ComboBox1.Text + ":/Windows/Prefetch")
    IO.File.Delete(f)
    ListBox1.Items.Clear()
    Next
    Label1.Text = ("Finished cleaning prefetch folder")
    End Sub

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs ) Handles LinkLabel1.LinkClicked
    Process.Start("")
    End Sub

    Private Sub LinkLabel1_LinkClicked_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs ) Handles LinkLabel1.LinkClicked
    Process.Start("")
    End Sub
    End Class
    [/php]


    Some of the blank ""s are where text would be(removed due to advertising rule)
    Last edited by Alroundeath; 07-28-2010 at 07:43 AM.

  2. #2
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Post code.

    We can't help you fix the error without seeing the code.

  3. #3
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    mscorlib.dll is trojan -.-

  4. #4
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by m_t_h View Post
    mscorlib.dll is trojan -.-
    I really hate to disrespect a minion, but that's a ridiculously stupid comment.

    One sec, I'll edit first post and add source code.

  5. #5
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Well the error is saying that there might not be files in the selected folder, so you need to check if there are files in the folder before doing any file operations.

  6. #6
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    try import system.io?

    about your compliment: well, just tell you that's trojan -.- instead of saying thanks you did that

  7. #7
    ~Shadow's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    STL
    Posts
    3,061
    Reputation
    33
    Thanks
    412
    My Mood
    Happy
    Quote Originally Posted by m_t_h View Post
    try import system.io?

    about your compliment: well, just tell you that's trojan -.- instead of saying thanks you did that
    a lot of people do that compared to the thanks people derserve

  8. #8
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by m_t_h View Post
    mscorlib.dll is trojan -.-
    Quote Originally Posted by m_t_h
    try import system.io?

    about your compliment: well, just tell you that's trojan -.- instead of saying thanks you did that
    Quote Originally Posted by ~Jay~
    a lot of people do that compared to the thanks people derserve
    Facewall !!

    @Problem:

    I see the problem during the buttonX1 and buttonX2's search. The error occurs only when the user selects the drive other than that on which system is installed. You can access the environment variables and get where the windows is installed. Also you are doing 1 more mistake. You are using invalid path seperator ("/") while it should be ("\"). The / is used for network paths, not for local paths. I've changed and fixed the code for you.

    This is the method for getting windows directory:


    Code:
    Dim winDir As String=Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine)
    Code:
    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
    Dim winDir As String=Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine)
            For Each file As String In searchDir(n & "\Prefetch")
                ListBox1.Items.Add(file)
            Next
    End Sub
    Code:
    Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
    Dim winDir As String=Environment.GetEnvironmentVariable("windir", EnvironmentVariableTarget.Machine)
            For Each f As String In searchDir(n & "\Prefetch")
                IO.File.Delete(f)
                ListBox1.Items.Clear()
            Next
            Label1.Text = ("Finished cleaning prefetch folder")
        End Sub
    When you can access the win directory, there's no need to ask user for where windows is installed. Just remove the comboBox and use the methods I just modified. That's the most effective way of doing this.

    Hope this helps ^_~
    Last edited by Hassan; 07-28-2010 at 11:46 AM.

  9. #9
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    mscorlib.dll isn't a trojan.

  10. #10
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    [php]dim folder as string = "C:\Windows\Whatever"

    If io.directory.exists(folder) then

    for each file as string in searchdirectory(folder)
    listbox1.items.add(file)
    next

    end if[/php]

    The for-each-loop will only be executed if the folder exists -> Prevents application from stop working.

    try import system.io?

    about your compliment: well, just tell you that's trojan -.- instead of saying thanks you did that
    /facewall a lot

    If he'd miss importing system.io, he couldn't even debug at all.

    You can either:

    Use io.directory.createdirectory / io.file.delete / io.file.exists
    WITHOUT IMPORTING SYSTEM.IO

    OR

    Use directory.createdirectory / file.delete / file.exists
    WITH IMPORTING SYSTEM.IO.

    So I see, you either didn't read his question at all or you don't know how to import



  11. The Following 2 Users Say Thank You to Blubb1337 For This Useful Post:

    Lolland (07-28-2010),Sick007 (08-01-2010)

  12. #11
    Alroundeath's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    331
    Reputation
    8
    Thanks
    29
    My Mood
    Amused
    Quote Originally Posted by m_t_h View Post
    try import system.io?

    about your compliment: well, just tell you that's trojan -.- instead of saying thanks you did that
    Urm... I'm not necessarily trying to... Make you look... Uh...

    Nevermind... It isn't a trojan though... ;/

    I like you M_T_H.. But I think you should google it next time :/


    As for the resonses, I believe it as because of a missing .dll from dotn*tB*r xP

Similar Threads

  1. [Help Request] Help crossfire error.
    By Jigsaw's Bitch in forum CrossFire Help
    Replies: 12
    Last Post: 09-17-2011, 08:09 AM
  2. [Help Request] I need Help with error
    By iKSAi in forum Alliance of Valiant Arms (AVA) Help
    Replies: 4
    Last Post: 06-28-2011, 01:26 AM
  3. [Please Help!] MHS Error when Opening Process
    By zorith in forum Combat Arms Hacks & Cheats
    Replies: 15
    Last Post: 08-29-2008, 11:25 AM
  4. HELP? gay errors
    By Gourav2122 in forum Hardware & Software Support
    Replies: 1
    Last Post: 12-09-2007, 10:35 AM
  5. [HELP] VB6 error while no-recoile
    By SteeL in forum WarRock - International Hacks
    Replies: 19
    Last Post: 11-06-2007, 11:08 PM