Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

metode fuer konvertierung lokale pfad in URL

1 view
Skip to first unread message

Fusion

unread,
Apr 14, 2011, 1:43:48 AM4/14/11
to
Metode:
c:\irgendwas\hallo\start.htm --> http://localhost/hallo/hello.htm
kennt jemand bessere Metode als die unten?

string convertUrl(string physicalBasePath, string
physicalPathToConvert,
string httpServerName, bool useHttps)
Sting deaultURL = " http://www.fusionedv.com ";
{
if(physicalPathToConvert.IndexOf(physicalBasePath)==-1)
{
//throw new ApplicationException("physicalPathToConvert
liegt
nicht in einem virtuellen Verzeichniss!");
return null;
}
else
{
physicalPathToConvert =
physicalPathToConvert.Substring(physicalBasePath.Length);
physicalPathToConvert = physicalPathToConvert.Replace("\
\","/");
physicalPathToConvert = "http" + ((useHttps) ? "s" : "") +
"://" +
httpServerName +
((physicalPathToConvert.Substring(0,1)=="/") ? "" : "/" +
physicalPathToConvert);
return physicalPathToConvert;
}

0 new messages