20

Is there a way to get the filename of the current query in LINQPad - just as argv[0] in C? Getting only the directory name would also do.

Guðmundur H
  • 11,478
  • 3
  • 24
  • 22
  • 1
    possible duplicate of [LINQPad script directory?](http://stackoverflow.com/questions/3802779/linqpad-script-directory) – Mark Hurd Mar 07 '14 at 11:10

1 Answers1

37

You can get the directory path like this (from - LINQPad script directory?) -

Path.GetDirectoryName(Util.CurrentQueryPath)

The following (as pointed out by sgmoore in the comments) will get you the file path -

Path.GetFileName(Util.CurrentQueryPath) 
Community
  • 1
  • 1
ipr101
  • 24,096
  • 8
  • 59
  • 61