Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How do I get the extension of a file.

 

I have a openfiledialog to get the file, then I want to check the extension and perform different actions based on the file extension.

 

I looked through the help and the only thing that was even close was file.attribute, but that is not what I need.

 

Example

 

if ofd.filename.extension="jpg" then

file.copy(ofd.filename,newname+ofd.filename.extension)

Posted

yeah, it's the same old vb story, great tools but hard to find if you don't know the names - if you knew the names you wouldn't need to find them.

 

At least now that everything is an object in a namespace it's a little more organized.

 

I like to sip tea and study the Object Browser...

mod2software

Home of the VB.NET Class Builder Utility - Demo and Full versions available now!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...