달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

1. 확인창 없이 종료 

<script language="javascript">

function winClose(){

window.open("about:black","_self").close();

}

</script>


버튼에 winClose()함수를 넣으면 된다


2. 일반 종료

onclick="javascript:window.close()"

onclick="javascript:self.close()"


Posted by dewlit
|

string str;

char cArray[20];


string에 char[]을 넣는 방법은

str = cArray;


char[]에 string을 넣는 방법은

for(j=0;j<str.length();j++){

cArray[j]=str[j];

cArray[str.length()]='\0';

}

또 다른 방법으로는 

cArray = str.c_str() 인데,

반환 값이 const char*이다.


wstring to wchar

wstring str;

wchar t[100];

str.copy(t, str.size());

t[str.size()] = '\0';

Posted by dewlit
|

삽질하다가 알고난 후에 깨우침+허탈함..


오늘도 역시ㅜㅜ


한 세시간 해매고 나서야 깨달았다는


우선 C에서 1차원 배열 넘길때

char arr[3];

main(){

func(arr);

}

void func(char arr[]);


2차원 배열 넘길때

char arr[5][20];

main(){

func(arr);

}

void func(char arr[][20]);

.........어렵다


그리고 포인터배열에 값 삽입하기

main(){

char *pa[5];

strncpy(pa[0],"문자열",길이); //하기 전에 반드시!!!!!!!!!!

pa[0]=malloc(sizeof("문자열")); // 을 해줘야 pa[0]에 값이 들어간다.

}


ㅠㅠㅠㅠㅠ



Posted by dewlit
|

.......참 문자 하나에 어이가 없을뿐..

class Exp

{

int base;

....

public:

....

....

}


클래스 선언부에 마지막에 ; 을 해주어야 한다.

class Exp

{

int base;

....

public:

....

....

....

};

Posted by dewlit
|

<uses-permission android:name="android.permission.INTERNET"/> - 인터넷연결 관련(소켓)

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> (폴더 만들기)

Posted by dewlit
|

해당 프로젝트 우클릭 후

Android tool -> Clear Lint Markers 선택 후 컴파일 하면

오류가 해결 된다.


출처 : http://vbflash.net/102

Posted by dewlit
|

자바 url 파일 받기

자바 2012. 8. 22. 15:14

import java.io.BufferedOutputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.net.URL;

import java.net.URLConnection;


public class test {

/**

* 버퍼 사이즈

*/

final static int size = 1024;


/**

* fileAddress에서 파일을 읽어, 다운로드 디렉토리에 다운로드

* @param fileAddress

* @param localFileName

* @param downloadDir

*/

public static void fileUrlReadAndDownload(String fileAddress,

String localFileName, String downloadDir) {

OutputStream outStream = null;

URLConnection uCon = null;

InputStream is = null;

try {

System.out.println("-------Download Start------");

URL Url;

byte[] buf;

int byteRead;

int byteWritten = 0;

Url = new URL(fileAddress);

outStream = new BufferedOutputStream(new FileOutputStream(

downloadDir + "\\" + localFileName));

uCon = Url.openConnection();

is = uCon.getInputStream();

buf = new byte[size];

while ((byteRead = is.read(buf)) != -1) {

outStream.write(buf, 0, byteRead);

byteWritten += byteRead;

}

System.out.println("Download Successfully.");

System.out.println("File name : " + localFileName);

System.out.println("of bytes  : " + byteWritten);

System.out.println("-------Download End--------");

} catch (Exception e) {

e.printStackTrace();

} finally {

try {

is.close();

outStream.close();

} catch (IOException e) {

e.printStackTrace();

}

}

}


/**

* @param fileAddress

* @param downloadDir

*/

public static void fileUrlDownload(String fileAddress, String downloadDir) {

int slashIndex = fileAddress.lastIndexOf('/');

int periodIndex = fileAddress.lastIndexOf('.');

// 파일 어드레스에서 마지막에 있는 파일이름을 취득

String fileName = fileAddress.substring(slashIndex + 1);

if (periodIndex >= 1 && slashIndex >= 0

&& slashIndex < fileAddress.length() - 1) {

fileUrlReadAndDownload(fileAddress, fileName, downloadDir);

} else {

System.err.println("path or file name NG.");

}

}


/**

* main

* @param args

*/

public static void main(String[] args) {

// 파일 어드레스

String url = "http://localhost/download/index.php";

// 다운로드 디렉토리

String downDir = "C:/Temp";

// 다운로드 호출

fileUrlDownload(url, downDir);

}

}


출처 : http://forum.falinux.com/zbxe/?document_srl=565194


'자바' 카테고리의 다른 글

Eclipse 배경색 background 복구 색 변경 default  (0) 2014.05.02
Gson 받기 사용 방법 두 가지  (0) 2013.06.05
gwt may need recompiled  (0) 2013.02.13
Posted by dewlit
|

msxml3.dll 오류 '800c0005'

ASP 2012. 7. 17. 11:10

.....

만약 내부 도메인( 자기 ip )를 호출할 경우에

에러가 난다면

localhost로 해보기 바란다

몇날을 해맨건지.....ㅠㅠ

'ASP' 카테고리의 다른 글

asp 폴더 내 파일 목록 보기  (0) 2012.07.09
asp xml 파싱  (0) 2012.07.09
asp에서 웹페이지 소스 가져오기, 파싱  (0) 2012.06.29
ASP UTF-8 파일 읽기,쓰기 및 실행 예제  (0) 2012.05.11
ASP 날짜 처리 함수  (0) 2012.05.10
Posted by dewlit
|

노팅힐 공부

English 2012. 7. 15. 23:01

  1. 내용이 익숙해 질때까지 자막영상으로 보기(2,3번정도)
  2. 전날 내용 복습-말하기&쓰기 3번반복
  3. 무자막감상
  4. 영어자막감상
  5. 영어대본으로 전체 문장 정확한 의미파악
  6. 동영상 반복시청으로 문장암기
  7. 감정실어서 연기하며 말하기
  8. 어느정도 암기가 되면 정확히 말하면서 쓰기
  9. 내용,상황을 생각하며 연기하면서 말하기
  10. 마무리로 한번 더 쓰면서 말하기

Posted by dewlit
|

<html>

<head>

<style type="text/css">


/* 링크에서 밑줄 없애기 */

a.no-uline { text-decoration:none }


/* 마우스 지나갈 때만 삭제 + 강제로 없애기 */

a.noul:hover { text-decoration:none !important }


</style>

</head>


<body>


<!-- 스타일을 직접 지정하여, 밑줄 지우기 -->

<a href="http://www.google.co.kr/" style="text-decoration:none">Google 검색</a>


<br />


<!-- a.no-uline 클래스를 이용하여, 밑줄 지우기 -->

<a href="http://www.google.co.kr/" class="no-uline">Google 검색</a>


<br />


<!-- 마우스를 가져갔을 때에만, 밑줄 지우기 -->

<a href="http://www.google.co.kr/" class="noul">Google 검색</a>


</body>

</html>


출처 : http://anianiani.net/1393

'HTML 및 웹' 카테고리의 다른 글

html 500 내부 오류  (0) 2012.03.29
Posted by dewlit
|