I am using this, to read 1+ files from the openFileDialog, but I am having a problem getting just the file name, I can get the location "C:\My Documents\filename.jpg" but how do I get just the name "filename.jpg"?

I want to replace it with this line: can.Text = Regex.Replace(file, ".+\\$", "")
vb.net Code:
  1. Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
  2.         Dim files
  3.         openFile.InitialDirectory = "C:\"
  4.         If openFile.ShowDialog = Windows.Forms.DialogResult.OK Then
  5.             files = openFile.FileNames
  6.             Dim f
  7.             Dim i = 0
  8.             For Each file In files
  9.                 Dim can As New Canvas
  10.                 f = Image.FromFile(file)
  11.                 can.contCanvas.Width = f.Width
  12.                 can.contCanvas.Height = f.Height
  13.                 can.MdiParent = Me
  14.                 can.Text = Regex.Replace(file, ".+\\$", "")
  15.                 Dim h = f.Height, w = f.Width
  16.                 can.ClientSize = New Size(w, h)
  17.                 can.Show()
  18.                 Dim layer = New Layer("layer0", can.contCanvas, can.mnu)
  19.                 layer.setImage(f)
  20.                 i += 1
  21.             Next
  22.         End If
  23.     End Sub