One way to do this is to use a GUID. GUIDs are not designed to be encountered, and this design also makes it difficult to determine valid GUIDs. I'm sure someone out there will tell me that it is not very safe! Well, you also protect the password. It is very easy to generate a GUID in C #.
, , -, , , , -, , GUID , , .
GUID, URL-, ( ) . URL/GUID, , , ( - ) , .
GUID, :
System.Guid.NewGuid().ToString()
, ( IIS7), web.config :
<modules>
<add name="MyDownloadModule" type="Example.MyDownloadModule, Example"/>
</modules>
MyDownloadModule - , , .
IHttpModule, :
public string ModuleName {
get { return "MyDownloadModule"; }
}
public void Init(HttpApplication app) {
app.BeginRequest += new EventHandler(this.AppBeginRequest);
}
private void AppBeginRequest(Object source, EventArgs e)
{
HttpRequest request = app.Context.Request;
if (request.AppRelativeCurrentExecutionFilePath == "~/downloads")
{
}
}
, , , .