Posted by 아로스

byte 수 체크

Windows/c# 2011. 9. 20. 18:01
 Encoding encKor = Encoding.GetEncoding("ks_c_5601-1987");                
Console.WriteLine(encKor.GetByteCount(inString));
Posted by 아로스

client ip address

Windows/c# 2011. 6. 3. 15:42

ASP .Net web page:

Expand|Select|Wrap|Line Numbers
  1. Dim strClientIP As String
  2. strClientIP = Request.UserHostAddress()
  3. Response.Write(strClientIP)
ASP .NET web services:
Expand|Select|Wrap|Line Numbers
  1. Context.Request.ServerVariables ["REMOTE_ADDR"]
Posted by 아로스
샘플보기
http://www.webresourcesdepot.com/dnspinger/


구조설명:

컨텐츠 페이지 구조
<div class="wrdLatest" id=1>content</div>
<div class="wrdLatest" id=2>content</div>
<div id="lastPostsLoader"></div>

로딩중 이미지 보여주는 부분과 실제 데이터 가져오는 부분
function lastPostFunc()
{
    $('div#lastPostsLoader').html('<img src="bigLoader.gif">');
    $.post("scroll.asp?action=getLastPosts&lastID=" + $(".wrdLatest:last").attr("id"),   


    function(data){
        if (data != "") {
        $(".wrdLatest:last").after(data);           
        }
        $('div#lastPostsLoader').empty();
    });
};

스크롤 감지하는 부분
$(window).scroll(function(){
        if  ($(window).scrollTop() == $(document).height() - $(window).height()){
          lastPostFunc();
        }
});


Posted by 아로스

날짜출력하기

Windows/c# 2011. 4. 1. 11:07

 string StrDate0, StrDate1, StrDate2, StrDayOfWeek, StrTime0, StrTime1, StrTime2;

            DateTime CurDate = DateTime.Now;

            StrDate0 = CurDate.Year.ToString("0000") +
                      CurDate.Month.ToString("00") +
                      CurDate.Day.ToString("00");

            StrDate1 = CurDate.ToShortDateString();
           StrDate2 = CurDate.ToLongDateString();

            StrDate0 = CurDate.Hour.ToString("00") +
                      CurDate.Minute.ToString("00") +
                      CurDate.Second.ToString("00");                      

            StrTime1 = CurDate.ToShortDateString();
           StrTime2 = CurDate.ToLongDateString();

            StrDayOfWeek = CurDate.DayOfWeek.ToString();

           DayOfWeek StrDayofWeek1 = CurDate.DayOfWeek;
           int StrDayofWeek2 = (int)CurDate.DayOfWeek;
Posted by 아로스

아로스

달력