For asp, if we get the file name of the current program, we can use the following code to get it. Isn't it very simple? Dim curUrl:curUrl = Replace(Request.ServerVariables(Script_Name),/,)