모바일 오유 바로가기
http://m.todayhumor.co.kr
분류 게시판
베스트
  • 베스트오브베스트
  • 베스트
  • 오늘의베스트
  • 유머
  • 유머자료
  • 유머글
  • 이야기
  • 자유
  • 고민
  • 연애
  • 결혼생활
  • 좋은글
  • 자랑
  • 공포
  • 멘붕
  • 사이다
  • 군대
  • 밀리터리
  • 미스터리
  • 술한잔
  • 오늘있잖아요
  • 투표인증
  • 새해
  • 이슈
  • 시사
  • 시사아카이브
  • 사회면
  • 사건사고
  • 생활
  • 패션
  • 패션착샷
  • 아동패션착샷
  • 뷰티
  • 인테리어
  • DIY
  • 요리
  • 커피&차
  • 육아
  • 법률
  • 동물
  • 지식
  • 취업정보
  • 식물
  • 다이어트
  • 의료
  • 영어
  • 맛집
  • 추천사이트
  • 해외직구
  • 취미
  • 사진
  • 사진강좌
  • 카메라
  • 만화
  • 애니메이션
  • 포니
  • 자전거
  • 자동차
  • 여행
  • 바이크
  • 민물낚시
  • 바다낚시
  • 장난감
  • 그림판
  • 학술
  • 경제
  • 역사
  • 예술
  • 과학
  • 철학
  • 심리학
  • 방송연예
  • 연예
  • 음악
  • 음악찾기
  • 악기
  • 음향기기
  • 영화
  • 다큐멘터리
  • 국내드라마
  • 해외드라마
  • 예능
  • 팟케스트
  • 방송프로그램
  • 무한도전
  • 더지니어스
  • 개그콘서트
  • 런닝맨
  • 나가수
  • 디지털
  • 컴퓨터
  • 프로그래머
  • IT
  • 안티바이러스
  • 애플
  • 안드로이드
  • 스마트폰
  • 윈도우폰
  • 심비안
  • 스포츠
  • 스포츠
  • 축구
  • 야구
  • 농구
  • 바둑
  • 야구팀
  • 삼성
  • 두산
  • NC
  • 넥센
  • 한화
  • SK
  • 기아
  • 롯데
  • LG
  • KT
  • 메이저리그
  • 일본프로야구리그
  • 게임1
  • 플래시게임
  • 게임토론방
  • 엑스박스
  • 플레이스테이션
  • 닌텐도
  • 모바일게임
  • 게임2
  • 던전앤파이터
  • 마비노기
  • 마비노기영웅전
  • 하스스톤
  • 히어로즈오브더스톰
  • gta5
  • 디아블로
  • 디아블로2
  • 피파온라인2
  • 피파온라인3
  • 워크래프트
  • 월드오브워크래프트
  • 밀리언아서
  • 월드오브탱크
  • 블레이드앤소울
  • 검은사막
  • 스타크래프트
  • 스타크래프트2
  • 베틀필드3
  • 마인크래프트
  • 데이즈
  • 문명
  • 서든어택
  • 테라
  • 아이온
  • 심시티5
  • 프리스타일풋볼
  • 스페셜포스
  • 사이퍼즈
  • 도타2
  • 메이플스토리1
  • 메이플스토리2
  • 오버워치
  • 오버워치그룹모집
  • 포켓몬고
  • 파이널판타지14
  • 배틀그라운드
  • 기타
  • 종교
  • 단어장
  • 자료창고
  • 운영
  • 공지사항
  • 오유운영
  • 게시판신청
  • 보류
  • 임시게시판
  • 메르스
  • 세월호
  • 원전사고
  • 2016리오올림픽
  • 2018평창올림픽
  • 코로나19
  • 2020도쿄올림픽
  • 게시판찾기
  • 오유인페이지
    개인차단 상태
    2Q14님의
    개인페이지입니다
    가입 : 13-01-21
    방문 : 468회
    닉네임변경 이력
    회원차단
    회원차단해제
    게시물ID : programmer_12504
    작성자 : 2Q14
    추천 : 0
    조회수 : 497
    IP : 1.239.***.132
    댓글 : 1개
    등록시간 : 2015/08/03 00:12:34
    http://todayhumor.com/?programmer_12504 모바일
    (본삭금) ASP.NET 로그인 인증관련 초급질문.....
    옵션
    • 본인삭제금지
    <div style="text-align:left;">안녕하십니까 프게형님들</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">우주왕초보가 또 질문하러 왔습니다.ㅎㅎㅎㅎㅎ</div> <div style="text-align:left;"><br></div> <div style="text-align:left;"> asp.net에서 제공하는 로그인 컨트롤로 해봤는데</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">이상하게 그 안에 들어있는 텍스트상자 내 문자열을 가져올수가 없더라고요.... </div> <div style="text-align:left;"><br></div> <div style="text-align:left;">그래서 빠른포기하고 직접 텍스트박스랑 버튼 갖다놨습니다.</div> <div style="text-align:left;"><br></div> <div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201508/1438527168yIekkAUrlCCJIbSMPBfM9RYWb.jpg" width="745" height="122" alt="K-002.jpg" style="font-size:9pt;line-height:1.5;border:none;"></div> <div style="text-align:left;"><br></div> <div style="text-align:left;"><br></div> <div style="text-align:left;">아이디 상자가 txtUserId 이고 비번 상자가 txtPassword 입니당</div> <div style="text-align:left;"><br></div> <div style="text-align:left;">사진 잘안 보일까봐 사진 밑에 코드 따로 붙여봤습니다.</div> <div style="text-align:left;"><br></div> <div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201508/1438527605ivx1g5cI9fr1sGEIM9xerD94o88V.jpg" alt="K-003.jpg" class="chimg_photo" style="border:none;height:968px;"></div><br><div> <div><font color="#0070c0">protected void btnLongin_Click(object sender, EventArgs e)</font></div> <div><font color="#0070c0">    {        </font></div> <div><font color="#0070c0">        string id=txtUserId.Text;</font></div> <div><font color="#0070c0">        string pwd=txtUserPassword.Text;</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">            if (Authenticate(id, pwd))</font></div> <div><font color="#0070c0">            {</font></div> <div><font color="#0070c0">                FormsAuthentication.SetAuthCookie(id, false); //!!!!!!!!!!!!!!!! 이렇게 하면 보안쿠키가 만들어지는 거 아닌가요???????????????</font></div> <div><font color="#0070c0">            }</font></div> <div><font color="#0070c0">    }</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">    private bool Authenticate(string id, string pwd)</font></div> <div><font color="#0070c0">    {</font></div> <div><font color="#0070c0">        bool result = false;</font></div> <div><font color="#0070c0">        </font></div> <div><font color="#0070c0">        string connectionString = WebConfigurationManager.ConnectionStrings["GongSaeng"].ConnectionString;</font></div> <div><font color="#0070c0">        SqlConnection conn = new SqlConnection(connectionString);</font></div> <div><font color="#0070c0">        SqlCommand cmd = new SqlCommand();</font></div> <div><font color="#0070c0">        cmd.Connection = conn;</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">        cmd.CommandText = "SELECT user_no FROM dbo.UserInfo WHERE id=@id AND password=@pwd";</font></div> <div><font color="#0070c0">        cmd.Parameters.AddWithValue("@id", id);</font></div> <div><font color="#0070c0">        cmd.Parameters.AddWithValue("@pwd", pwd);</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">        conn.Open();</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">        SqlDataReader rd = cmd.ExecuteReader();</font></div> <div><font color="#0070c0">        </font></div> <div><font color="#0070c0">        if (rd.HasRows)</font></div> <div><font color="#0070c0">        {</font></div> <div><font color="#0070c0">            int no= (int)rd["user_no"];</font></div> <div><font color="#0070c0">           </font></div> <div><font color="#0070c0">            if (no == 3)                  // 관리자 회원번호입니다만 저는 일단 일반회원 아이디로 로그인했습니다.</font></div> <div><font color="#0070c0">            {</font></div> <div><font color="#0070c0">                Response.Redirect("~/admin/Default.aspx");</font></div> <div><font color="#0070c0">            }</font></div> <div><font color="#0070c0">            result = true;</font></div> <div><font color="#0070c0">            rd.Close();</font></div> <div><font color="#0070c0">        }</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">        else </font></div> <div><font color="#0070c0">        {</font></div> <div><font color="#0070c0">            result = false;</font></div> <div><font color="#0070c0">        }</font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">        conn.Close();</font></div> <div><font color="#0070c0">        return result;</font></div> <div><font color="#0070c0">    }</font></div></div> <div><br></div> <div><br></div> <div><br></div> <div><br></div> <div><font size="2"><br></font></div> <div><font size="2">이렇게 해서 돌려봤습니다.</font></div> <div><font size="2"><br></font></div> <div><font size="2">지금 데이터베이스에는 회원번호 2짜리 일반회원 아이디 밖에 없고요.... (1번은 테스트하다가 날라갔는데 시드값을 1씩 증가하게 해놔서ㅜㅜㅜ)</font></div> <div><font size="2"><br></font></div> <div><font size="2">그 아이디로 로그인하면 그냥 메인 화면으로 돌아옵니다.</font></div> <div><font size="2"><br></font></div> <div><font size="2">클릭이벤트의 if구문밑에 else구문 넣고 비번 틀리면 오류표시하게도 해봤습니다.</font></div> <div><font size="2"> 틀리게 로그인했을때 오류뜨는거보니 함수는 알맞게 만든것 같기도 합니다.</font></div> <div><br></div> <div><font size="2">근데 저대로면 보안 쿠키가 생성되어서 로그인 되었다는 표시가 되어야하지 않나요??</font></div> <div><font size="2"><br></font></div> <div><font size="2">메인에 로그인뷰 컨트롤을 넣어놨습니다.</font></div> <div><br></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0"><br></font></div> <div> <div><font color="#0070c0"><asp:LoginView ID="lvMiddleLogin" runat="server"></font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">         <AnonymousTemplate> </font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">                                                                                     // 생략합니당ㅎㅎㅎ  로그인 박스 만들어놨습니다.</font></div> <div><font color="#0070c0">          </AnonymousTemplate></font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">          <LoggedInTemplate></font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">                <span style="font-size:9pt;line-height:1.5;">   <asp:LoginName ID="lnMiddleName" runat="server" /> 님 반갑습니다.</span></font></div> <div><span style="font-size:9pt;line-height:1.5;"><font color="#0070c0"><br></font></span></div> <div><font color="#0070c0">                    <asp:LinkButton ID="lkbtnMiddleInfoUpdate" runat="server" ForeColor="Black">회원정보수정</asp:LinkButton></font></div> <div><span style="font-size:9pt;line-height:1.5;"><font color="#0070c0"><br></font></span></div> <div><span style="font-size:9pt;line-height:1.5;"><font color="#0070c0">                    <asp:LoginStatus ID="lsMiddleStatus" runat="server" /></font></span></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0">           </LoggedInTemplate></font></div> <div><font color="#0070c0"><br></font></div> <div><font color="#0070c0"></asp:LoginView></font></div></div> <div><br></div> <div><br></div> <div><br></div> <div><br></div> <div><br></div> <div>보안쿠키가 만들어지는거하고 로그인뷰하고는 별개인가요?</div> <div>제가 따로 연결을해야하나요???</div> <div><br></div> <div> <div>로그인 했을 때 여기에 ~님 반갑습니다! 하고 뜨게하는 방법이 뭘까요?ㅜㅜㅜ</div></div> <div><br></div> <div><br></div> <div>사랑하는 프게님들 부탁드립니다</div> <div><br></div>
    2Q14의 꼬릿말입니다
    가끔 네 꿈을 꾼다. 

    전에는 꿈이라도 꿈인 줄 모르겠더니

    이제는 너를 보면

    아, 꿈이로구나, 

    알아챈다.

    -황인숙, 꿈

    이 게시물을 추천한 분들의 목록입니다.
    푸르딩딩:추천수 3이상 댓글은 배경색이 바뀝니다.
    (단,비공감수가 추천수의 1/3 초과시 해당없음)

    죄송합니다. 댓글 작성은 회원만 가능합니다.

    번호 제 목 이름 날짜 조회 추천
    69
    서울대, 안티-페미니즘 총학생회장 당선 [1] 2Q14 17/11/22 20:37 230 24
    68
    한양대 총남학생회 공약 예비목록 [5] 2Q14 17/11/22 18:25 205 14
    67
    한양대 총여학생회 뷔페식 페미니즘 논란 [2] 2Q14 17/11/22 18:17 183 28
    66
    바보질문) 중고폰 팔때 유심 빼서주나요? [5] 본인삭제금지 2Q14 17/08/04 19:33 45 2
    65
    이 부품이름 아시는분!!! [5] 2Q14 17/05/26 05:35 90 0
    64
    본삭금) 서버 컴 견적도 봐주실수있나요...? [6] 본인삭제금지 2Q14 17/05/14 11:59 58 1
    63
    본삭금) 혹시 이 포트 뭔지 아시는분??????? [5] 본인삭제금지 2Q14 17/04/25 06:11 102 0
    62
    의정부시청쪽 인스팅트가 다 먹었어요! [7] 2Q14 17/02/03 11:30 324 8
    61
    니트 털빠짐ㅜㅜㅜㅜㅠ 본인삭제금지 2Q14 16/11/20 20:39 46 0
    60
    UV차단 선글라스 추천부탁드려요! 10만원이하로..ㅜㅜ [1] 본인삭제금지 2Q14 16/08/20 11:34 26 0
    59
    오늘 신봉선 하드캐리하네요ㅋㅋㅋㅋㅋㅋㅋ [2] 2Q14 16/08/07 18:32 224 3
    58
    바하제품 쓰면서 코팩해도 되나요? 본인삭제금지 2Q14 16/06/22 14:48 33 0
    57
    박유천 4번째 피해자진술 거짓으로 밝혀져 [1] 2Q14 16/06/20 18:58 410 11
    56
    중고등학생분들께 질문 [1] 2Q14 16/06/17 20:21 35 1
    55
    로하셀이라는 브랜드 유명한가요? [6] 2Q14 16/06/08 09:19 103 1
    54
    약혐,도움!) 코 모공 어찌하나요ㅜㅜㅜㅜㅜㅠㅠㅠ [13] 본인삭제금지 2Q14 16/06/07 19:26 209 2
    53
    디오메르 기초화장품 써보신 분 계세요??? [2] 본인삭제금지 2Q14 16/06/01 18:58 39 0
    52
    히팅젤 이거 열이 안나는데 불량품인가요? [10] 본인삭제금지 2Q14 16/05/21 11:37 183 2
    51
    본삭금 질문) 아침에 물세안 하시는 분?? [12] 본인삭제금지 2Q14 16/05/15 16:31 200 2
    50
    본산금질문,사진) 여드름 짜다가 흉진 곳에 바르는 연고 [7] 본인삭제금지 2Q14 16/05/15 04:18 195 0
    49
    본삭금) 포맷후 용량 줄어듦문제 [4] 본인삭제금지 2Q14 16/01/04 21:43 37 0
    48
    본삭금)노트북CPU교체; T4200(펜린)에서 i3샌디브릿지 로 [6] 본인삭제금지 2Q14 16/01/02 13:40 69 0
    47
    본삭금) 노트북 램, ssd 교체 질문 드려요 본인삭제금지 2Q14 16/01/01 16:47 31 0
    46
    본삭금 질문) 아크릴재질 부품도색 [3] 본인삭제금지 2Q14 15/11/27 21:25 11 1
    45
    레바툰) 단체미팅하는 만화 [2] 2Q14 15/10/31 19:44 42 4
    44
    뭐가오네? [8] 펌글 2Q14 15/08/20 22:05 207 10
    43
    (본삭금질문) 수딩젤 vs 수분크림 [5] 본인삭제금지 2Q14 15/08/10 12:15 52 0
    42
    (본삭금) C# 왕초보질문 (+DB약간) [2] 본인삭제금지 2Q14 15/08/08 23:07 14 0
    (본삭금) ASP.NET 로그인 인증관련 초급질문..... [1] 본인삭제금지 2Q14 15/08/03 00:12 25 0
    40
    (본삭금) 웹호스팅 하드용량에 대하여 [3] 본인삭제금지 2Q14 15/07/31 23:19 23 0
    [1] [2] [3]
    단축키 운영진에게 바란다(삭제요청/제안) 운영게 게시판신청 자료창고 보류 개인정보취급방침 청소년보호정책 모바일홈