Adblock breaks this site

Simple Problem

Discussion in 'Programming General' started by X Zero, Jun 9, 2007.

  1. X Zero

    X Zero Forum Addict

    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0
    Simple Problem

    Well, I have a simple problem, let me explain.

    I have this code:
    Code:
    Public Sub New()
    InitializeComponent()
    On Error Resume Next
    If File.Exists(String.Join(" ", Environment.GetCommandLineArgs(), 1, Environment.GetCommandLineArgs().Length - 1)) Then
     MsgBox(Environment.CurrentDirectory.ToString)
    Me.textBox1.Text = File.ReadAllText(String.Join(" ", Environment.GetCommandLineArgs(), 1, Environment.GetCommandLineArgs().Length - 1))
    End If
    End Sub
    new question how can it get the file name use the Environment thing

    This how I got the path.
    Code:
    MsgBox(Environment.CurrentDirectory.ToString)

    How can this be achived?
     
  2. speljohan

    speljohan Guru
    Visual Basic Programmers

    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0
    Simple Problem

    It would seem the command line arguments are read as dos strings. I'm not sure how do fix this, maybe by outputting it differently?
     
  3. X Zero

    X Zero Forum Addict

    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0
    Simple Problem

    so, how would i change it?

    Thanks for a quick reply
     
  4. X Zero

    X Zero Forum Addict

    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0
    Simple Problem

    Solved......
     
< Webbrowser troubles. | Java guide >


 
 
Adblock breaks this site