MDIMain : 로그인후 나타나는 윈도우
구로디지털단지역 오엔제이프로그래밍 실무교육센터
(Java , Oracle, SQL, Oracle Tuning, BackUP& Recovery, ASP.NET,
C#, C#Network ,채용확정 무상교육)
www.onjprogramming.co.kr
www.onjprogramming.co.kr
MDIMain의 생성자에서 FrmLogin을 로딩하고 여기서 아이디와 비밀번호로 인증을 한 후 그 결과를 MDIMain으로 넘김으로써 인증처리는 하는 예제 입니다.
(로그인 후 로그인 창은 종료 됩니다.)
앞 강좌의 주소록에 포함되어 있지만 이 부분만 분리했습니다.
--------------------------------------------------------------
==============================================
FrmLogin.cs
==============================================
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace 주소록
{
/// <summary>
/// FrmLogin에 대한 요약 설명입니다.
/// </summary>
public class FrmLogin : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txtID;
private System.Windows.Forms.TextBox txtPWD;
/// <summary>
/// 필수 디자이너 변수입니다.
/// </summary>
private System.ComponentModel.Container components = null;
public FrmLogin()
{
//
// Windows Form 디자이너 지원에 필요합니다.
//
InitializeComponent();
//
// TODO: InitializeComponent를 호출한 다음 생성자 코드를 추가합니다.
//
}
/// <summary>
/// 사용 중인 모든 리소스를 정리합니다.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtID = new System.Windows.Forms.TextBox();
this.txtPWD = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label1.Location = new System.Drawing.Point(16, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(19, 15);
this.label1.TabIndex = 0;
this.label1.Text = "ID";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.label2.Location = new System.Drawing.Point(16, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 15);
this.label2.TabIndex = 1;
this.label2.Text = "PassWord";
//
// txtID
//
this.txtID.Location = new System.Drawing.Point(104, 8);
this.txtID.Name = "txtID";
this.txtID.Size = new System.Drawing.Size(120, 21);
this.txtID.TabIndex = 2;
this.txtID.Text = "";
//
// txtPWD
//
this.txtPWD.Location = new System.Drawing.Point(104, 32);
this.txtPWD.Name = "txtPWD";
this.txtPWD.PasswordChar = '*';
this.txtPWD.Size = new System.Drawing.Size(120, 21);
this.txtPWD.TabIndex = 3;
this.txtPWD.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(232, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(56, 48);
this.button1.TabIndex = 4;
this.button1.Text = "로그인";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// FrmLogin
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(304, 69);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.txtPWD,
this.txtID,
this.label2,
this.label1});
this.Name = "FrmLogin";
this.Text = "FrmLogin";
this.ResumeLayout(false);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new FrmLogin());
}
private OleDbConnection LocalConn;
//---------------------------------------------//
//--------------------------------------------//
//------- 이 부분이 인증을 하는 부분 입니다. ----//
//---------------------------------------------//
//--------------------------------------------//
private void button1_Click(object sender, System.EventArgs e)
{
OleDbDataReader myReader;
string sql = null;
try
{
LocalConn = Common_DB.DBConnection();
LocalConn.Open();
if (txtID.Text == "" || txtPWD.Text == "")
{
MessageBox.Show("ID 또는 Password를 입력 하세요...");
return;
}
sql = "select pwd from member ";
sql += " where id = " + "'" + txtID.Text + "'";
myReader = Common_DB.DataSelect(sql, LocalConn);
if (myReader.Read())
{
if (txtPWD.Text != myReader["pwd"].ToString())
{
MessageBox.Show("Password가 맞지 않습니다...");
return;
}
}
else
{
MessageBox.Show("등록되지 않은 ID 입니다.");
return;
}
//----------- ID가 PWD가 맞는 경우
MDIMain.loginOK = true;
//---------------------------------
this.Close();
}
catch(Exception e1)
{
Log.WriteLine("FrmLogin", e1.ToString());
MessageBox.Show("FrmLogin", "로그인 오류! " + sql );
}
}
}
}
==============================================
MDIMain.cs
==============================================
아래는 MDIMain의 생성자 부분 입니다.
//---------------------- FOR LOGIN
static FrmLogin login = null;
internal static bool loginOK = false;
//-----------------------------------
[STAThread]
static void Main()
{
loginOK = false;
login = new FrmLogin();
Application.Run(login);
if (loginOK)
{
MDIMain m = new MDIMain();
login.Close();
Application.Run(m);
}
}
오라클자바커뮤니티 추천강좌-JAVA&WEB프레임워크실무과정
(8/31온라인 지원가능!! 홈페이지에서 지원신청 바랍니다.)
| 강좌명 | JAVA&WEB프레임워크실무과정(주말주간(토/일)) |
|---|---|
| 교재 | 자체교재 무료제공 |
| 강좌 일정 | 09월01일(일) ~ 10월26일(토)((주말주간(토/일)) 10:00~18:00, 14일) 총 98시간 |
| 강의 장소 | [B강의장]구로디지털단지역2번 출구-> 미니스톱끼고 우회전 -> 100m 직진
후 골목길 끝에서 이마트방향 우회전 -> 50m 직진 후 우체국 옆골목으로 길건너서 직진 -> 150미터 직진 후 JnK 타워에서
우회전 -> 50미터 직진 후 우측에 코오롱빌란트2차 803호 (구로구 구로3동 222-8 코오롱디지털타워 빌란트2차
803호) [약도보기] |
| 수강절차 | - 강좌내용 확인 - 전화 또는 홈페이지(www.onjprogramming.co.kr)를 통한 수강지원 및 수강료 결제(무통장입금, 온라인 카드결제) - 고용보험 가입자(재직자)인 경우 고용보험환급 관련 서류 제출 - 수강전 : 커리큘럼 및 장소에 대해 다시 한번 공지 - 교육 전 설문 작성(간단한 개발 경력, 수강 목적, 강좌진행방식 등) - 강좌 수강 - 수강후 : 교육 후 설문 작성 |
| 수강료 | - 1,200,000원 [고용주환급]대기업:40만원 전후,중소기업:48만원 전후 환급 [개인수강지원(개인환급)]정규직960,000원 ,비정규직:전액환급 대기업(상시근로자 300인 이상 대기업)은 개인환급 불가합니다. 재직자 내일배움카드 : 정부지원금 80% 자기부담금 20% (구 능력개발카드 명칭이 내일배움카드로 변경 / 연간 총한도 200만원 * 휴강 :법정공휴일 / 추석 연휴 9월17일 휴강 |
| 수강료 입금안내 |
- 온/오프라인 카드결제, 계좌이체(수강안내->입금안내 참조) |
| 문의사항 | 02-851-4790 번으로 연락 부탁 드립니다. |
| 교육개요 | 본과정은 프로그래밍 언어의 경험이 있는 분이지만 자바를 처음하시는 분들을 위해 현장에서 필요로 하는 기술들을 최적화된 커리큘럼 및 강사를 통해 배울 수 있도록 하는 과정 입니다. 자바의 기본적인 사항부터 JDBC 프로그래밍, 모든 개발의 근간이 되는 자바네트워크 프로그래밍(이거 안하시면 2~3년지나서 UI개발자의 틀을 벗어 날 수 없습니다), 자바웹의 기본이되는 JSP, 그리고 최근 가장널리 사용되는 Ajax, jQuery를 통해 화면 깜박임없이 웹페이지를 역동적으로 구성할 수 있도록 배우고 최근 가장 많이 사용되는 JAVA기반의 프레임워크인 Spring Framework, SQL Data Mapper인 MyBatis까지 배울 수 있는 과정으로 자바 웹 개발자로 가시고자 하는 분들을 위한 최적의 과정 입니다. 본과정을 통해 기초부터 하나씩 배우신다면 내공 있는 자바 개발자가 되실것을 확신합니다! |
| 교육목표 | - 자바 기본문법의 이해 - 자바 네트워크 프로그래밍에 대한 이해 - JDBC 개발에 대한 이해 - 자바 웹개발에 대한 이해 - JSP의 작동원리 및 기본문법의 이해 - Ajax 및 jQuery에 대한 이해 - WAS(Web Application Server) 및 Web Server에 대한 이해 - 자바기반 프레임워크에 대한 이해(Spring3.X) - SQL Mapper(MyBatis)에 대한 이해 - 실무 자바기술의 전반적인 이해 및 활용 |
| 교육대상 | - 자바 초보 개발자 - 신입개발자 - 다른 언어를 사용하다가 자바쪽으로 전향을 원하는 개발자 - 자바를 배우고자 하는 학생 |
| 선수학습 | - 프로그래밍에 대한 이해 |
| Java Fundamental | 자바 언어 소개,기본 문법 Virtual Machine 소개/메모리 영역 클래스 패스(Class Path) 개요 Array 이론/실습 클래스와 객체(Class & Object) Abstarct Data Type, 상속(Inheritance)과 다형성 추상클래스(Abstract Class)와 다형성 인터페이스(Interface)와 다형성 연관(Aggregation & Composition) 오버로딩(OverLoading)과 오버라이딩(Overriding) this/super/constructor Package 만들기 이론/실습 Java에서 예외 처리 요령 사용자 예외 처리 방법 스트림(Stream) 입출력 관련 클래스, InputStream/OutputStream, FileInputStream/FileOutputStream Reader/Writer등 입출력 관련 클래스 표준 입출력/FILE 처리, 객체 직렬화 이론/실습 Thread 개요 Java에서의 Process Thread Joining/Interrupt |
|---|---|
| Java Network | URL/HTTP URL, URLConnection, HttpURLConnection, URLEncoding, URLDecoding 클래스
개요 URL을 다루는 예제 실습(Get/Post) Client Socket과 Server Socket의 개요 MultiThread EchoServer Socket을 이용한 예제 구현 UDP Programming(Multicasting programming) UDP/Datagram 개요 DatagramSocket, DatagramPacket 소개 UDP를 이용한 예제 구현 Multicast 소개 Multicast Client/Server 구현 Distributed Computing(java RMI) Distributed Computing, Object 소개 Java RMI를 이용한 “Hello World” 제작 RMI 응용예제 실습 |
| JDBC Programming | JDBC Driver 소개 JDBC 연결방법 Connection, Statement, ResultSet, PreparedStatement Oracle의 function, procedure 다루기 DBCP, DataSource, Connection Pool |
| JSP(Java Server Page) | JSP 기본문법, 작동원리 JSP 내장 객체,Java Beans JSP에서의 Session, Cookie 다루기 Custom Tag MVC Model(Model2)의 이해 및 활용 |
| Ajax/jQuery | Ajax 개발환경 구축 왜 Ajax 인가? Ajax의 기본 구성 XMLHttpRequest 객체 innerHTML의 사용 DOM(Document Object Model) 다루기 Ajax MVC jQuery 소개, 개요 jQuery 응용 예제 |
| Spring Framework3.2 | J2EE Framework에 대한 흐름과 Spring Framework에 대한 이해 개발 환경 설정(Eclipse4.2, Tomcat7, Spring3.2 다운로드 및 설치) Spring IoC DL(Dependency LookUp) &DI(Dependency Injection) DL. DI 예제를 통한 이해 Spring 설정 상세 Spring AOP 란 ?Code, Advice, JoinPoint, PointCut, Aspect, WeavingProxyFactoryBean Annotation기반 AOP(AspectJ) Spring JDBC Spring Web MVC Sprint Web Flow Spring Controller Spring MVC TEST Framework Spring3.2 New Feature |
| MyBatis/Hibernate | [MyBatis] 개요 및 소개 개발환경 설정 및 설치 Data Mapper란 sqlMapConfig 이해 및 환경설정 Spring, MyBatis 연동 SQL Map XML File 이해 SqlMapClient 이해 SQL의 실행(Insert/update/delete) 이해와 실습 고급 쿼리 사용방법의 이해와 실습 Spring MyBatis 응용예제 작성 [Hibernate] Hibernate 소개 SessionFactory 설정 1:1, 1:다 매핑 Session Interface Hibernate DML Spring, Hibernate 예제 프로그램 작성 |
| Mini Project | Spring 게시판 작성 실습 -- 게시판 구현에 대해 철저하게 이해한다면 실무에서의 개발도 충분히 가능 합니다. |
댓글 없음:
댓글 쓰기