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 아로스

<html>
<head>
<title></title>

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script language=JavaScript>
//전체 선택/해제
 function selectAll(){
 var c = $('#checkAll').attr('checked');
 $('input[name=chkid]').attr('checked',c);
 }
 //선택된 값 보기
 function getSelectVal(){
 var idlist = [];
 var itemstr ="";
 $('input[name=chkid]:checked').each(function(){idlist.push(this.value)});
 
 $.each(idlist,function(index, item){
  itemstr += item + ',';
 });

 $('#resultID').text(itemstr);
 }
</script>

</head>
<body>

 <input type="checkbox" id="checkAll" class="chk" onclick="selectAll()" /> 전체선택<P/>


 <input type="checkbox" name="chkid"  value="1" class="chk" />1<P/>
 <input type="checkbox" name="chkid"  value="2" class="chk" />2<P/>
 <input type="checkbox" name="chkid"  value="3" class="chk" />3<P/>
 <input type="checkbox" name="chkid"  value="4" class="chk" />4<P/>
 <input type="checkbox" name="chkid"  value="5" class="chk" />5<P/>
 <input type="checkbox" name="chkid"  value="6" class="chk" />6<P/>
 <input type="checkbox" name="chkid"  value="7" class="chk" />7<P/>


 <input type="button" id="showval" onclick="getSelectVal()" value="선택값 보기" />


  당신이 선택하신 값은<span id="resultID"></span> 입니다.


</body>
</html>

Posted by 아로스

아로스

달력

05-18 17:56