Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:25:19+00:00 2026-06-12T03:25:19+00:00

In my application I have my own custom filetype. I set it up so

  • 0

In my application I have my own custom filetype. I set it up so my application opens up files of this type when they are clicked outside of my application. Now my question is: How can I get the SafeFileName of the file being opened? I know that that variable S is my filename, although I want to get just the actual files name without the location.

    If (Environment.GetCommandLineArgs.Length > 1) Then

      Dim s As String = Environment.GetCommandLineArgs(1)

     ' Open file s

    End If

I know if I was using the filename it would be OpenFileDialog.SafeFileName, and that would give me test123.txt instead of C:\Files\Test123.txt

How could I do the same in this situation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:25:20+00:00Added an answer on June 12, 2026 at 3:25 am

    It depends on what the string that is being returned looks like and if it is a valid path, if it is like your example you can use Path.GetFileName Method of the System.IO Namespace.

    Dim s As String = "C:\Files\Test123.txt"
    Dim myFile As String = Path.GetFileName(s)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application where I'm trying to implement my own custom keyboard. This
I'm building an application that has its own custom chrome. I have turned the
We have an ASP.NET MVC application for which we have developed our own custom
I have a Spring MVC application. It uses its own custom Login page .
I'm writing a web based application that will have its own authorization/authentication mechanism (traditional
I've got an asp.net application where each client will have their own data entry
I'm currently working on a simple web application where users each have their own
We have an application that is essentially implementing its own messaging queue. When a
I have created my own debugger application. It attaches to a process and creates
I have an application where users select their own display columns. Each display column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.