/// <summary>
///サイトユーザーIPを取得します
/// </summary>
/// <returns> </returns>
public static string getUserip()
{
return httpcontext.current.request.servervariables ["remote_addr"]。toString();
}
/// <summary>
///最後の '、'文字列の番号を削除します
/// </summary>
/// <param name = "chr">:処理する文字列</param>
/// <Returns>処理された文字列</returns>を返します
public static string lost(string chr)
{
if(chr == null || chr == string.empty)
{
戻る "";
}
それ以外
{
chr = chr.remove(chr.lastindexof( "、"));
chrを返します。
}
}
/// <summary>
///文字列の最初の '/'番号を削除します
/// </summary>
/// <param name = "chr">処理する文字列</param>
/// <Returns>処理された文字列</returns>を返します
public static stringlostfirst(string chr)
{
文字列flg = "";
if(chr!= string.empty || chr!= null)
{
if(chr.substring(0、1)== "/")
flg = chr.replace(chr.substring(0、1)、 "");
それ以外
flg = chr;
}
flgを返します。
}
/// <summary>
/// HTMLの特殊文字を交換します
/// </summary>
/// <param name = "thestring">交換する必要があるテキスト。 </param>
/// <返品>テキストを交換しました。 </returns>
public static string htmlencode(string thestring)
{
thestring = thestring.replace( ">"、 ">");
thestring = thestring.replace( "<"、 "<");
thestring = thestring.replace( ""、 "");
thestring = thestring.replace( ""、 "");
thestring = thestring.replace( "/" "、" "");
thestring = thestring.replace( "/'"、 "'");
thestring = thestring.replace( "/n"、 "<br/>");
thestringを返します。
}
/// <summary>
/// HTMLの特殊文字を復元します
/// </summary>
/// <param name = "thestring">復元する必要があるテキスト。 </param>
/// <Returns>良いテキストを復元します。 </returns>
public static string htmldiscode(string thestring)
{
thestring = thestring.replace( ">"、 ">");
thestring = thestring.replace( "<"、 "<");
thestring = thestring.replace( ""、 "");
thestring = thestring.replace( ""、 "");
thestring = thestring.replace( "" "、"/"");
thestring = thestring.replace( "'"、 "/'");
thestring = thestring.replace( "<br/>"、 "/n");
thestringを返します。
}
/// <summary>
///乱数を生成します
/// </summary>
/// <param name = "length">生成長</param>
/// <returns> </returns>
public static string number(int length)
{
返品番号(長さ、false);
}
/// <summary>
///乱数を生成します
/// </summary>
/// <param name = "length">生成長</param>
/// <param name = "sleep">重複を避けるために生成前に現在のスレッドをブロックするかどうか</param>
/// <returns> </returns>
public static string number(int length、bool sleep)