Simple Problem

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

Simple Problem
  1. Unread #1 - Jun 9, 2007 at 5:09 AM
  2. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    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?
     
  3. Unread #2 - Jun 9, 2007 at 5:55 AM
  4. speljohan
    Joined:
    Apr 24, 2005
    Posts:
    1,450
    Referrals:
    3
    Sythe Gold:
    0

    speljohan Guru
    Visual Basic Programmers

    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?
     
  5. Unread #3 - Jun 9, 2007 at 6:10 AM
  6. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Simple Problem

    so, how would i change it?

    Thanks for a quick reply
     
  7. Unread #4 - Jun 10, 2007 at 12:32 AM
  8. X Zero
    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0

    X Zero Forum Addict

    Simple Problem

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

Users viewing this thread
1 guest


 
 
Adblock breaks this site