Get executing assembly name using reflection

前端 未结 5 1059
清酒与你
清酒与你 2020-12-19 09:00

I am trying to pull the project name using the reflection, but during the substring method it give me \"index out of bound error\".

string s = System.Reflec         


        
5条回答
  •  庸人自扰
    2020-12-19 09:32

    Try:

    System.IO.Path.GetFileName(System.Reflection.Assembly.GetExecutingAssembly().Location)
    

提交回复
热议问题