우드락
폼보드
포맥스
내가 찾던게 포맥스 인가 보네..
이걸로 로봇팔 만들고 그러는걸 본거 같은데...
'하드웨어 > 3D 프린터 CNC' 카테고리의 다른 글
3d print z seam(솔기) (0) | 2024.02.22 |
---|---|
3D 프린터와 CNC (0) | 2018.01.26 |
16만원짜리 ANET A8 3d 프린터 ㄷㄷ (0) | 2017.12.28 |
3d 프린터가 급 끌리네... (0) | 2017.02.28 |
우드락
폼보드
포맥스
내가 찾던게 포맥스 인가 보네..
이걸로 로봇팔 만들고 그러는걸 본거 같은데...
3d print z seam(솔기) (0) | 2024.02.22 |
---|---|
3D 프린터와 CNC (0) | 2018.01.26 |
16만원짜리 ANET A8 3d 프린터 ㄷㄷ (0) | 2017.12.28 |
3d 프린터가 급 끌리네... (0) | 2017.02.28 |
아놔...
대충 검색하고 하다 보니.. username / password가 있는지도 몰랐네
한마디로 하루 작업한거 괜히 뻘짓 되는 저 마법의 두 인자.. -_ㅠ
CHttpConnection* GetHttpConnection( LPCTSTR pstrServer, INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER, LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL ); CHttpConnection* GetHttpConnection( LPCTSTR pstrServer, DWORD dwFlags, INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER, LPCTSTR pstrUserName = NULL, LPCTSTR pstrPassword = NULL ); |
[링크 : https://msdn.microsoft.com/ko-kr/library/59kzsz14(v=vs.71).aspx]
---
수동으로.... 구현 -_ㅠ 아놔..
아무튼 AddRequestHeaders()는 제대로 된 형태가 아니면 삽입이 되지 않고
해당 HTTPConnection은 재사용해도 문제가 되진 않는다.
pHttpFile->SendRequest(); pHttpFile->QueryInfoStatusCode(m_dwStatusCode); pHttpFile->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, szHeaders); switch(m_dwStatusCode) { case HTTP_STATUS_OK: { CString strResult; while(pHttpFile->ReadString(strResult)) { strResult.ReleaseBuffer(); } } break; case HTTP_STATUS_DENIED: // unauthorized { CString realm; CString nonce; CString cnonce("0000000000"); CString str; pHttpFile->QueryInfo(HTTP_QUERY_WWW_AUTHENTICATE, szHeaders); delete pHttpFile; int curPos = 0; CString resToken; CString key; CString val; resToken = szHeaders.Tokenize(_T(" "), curPos); while(!resToken.IsEmpty()) { // Obtain next token key = resToken = szHeaders.Tokenize(_T("="), curPos); val = resToken = szHeaders.Tokenize(_T("\""), curPos); resToken = szHeaders.Tokenize(_T(" "), curPos); if(0 == key.Compare(_T("nonce"))) nonce = val; if(0 == key.Compare(_T("realm"))) realm = val; } CString HA1,HA2,RES; HA1 = md5gen(str = id+":"+realm+":"+pw); HA2 = md5gen(str = CString("GET:")+query); RES = md5gen(str = HA1+":"+nonce+":00000001:"+cnonce+":auth:"+HA2); pHttpFile = pHttpConnect->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject); auth.Append(_T("Authorization: ")); auth.Append(szHeaders); auth.Append(_T(",username=\"")); auth.Append(id+"\","); auth.Append(_T("uri=\"")); auth.Append(query+"\","); auth.Append(_T("cnonce=\"")); auth.Append(cnonce+"\","); auth.Append(_T("nc=00000001,response=\"")); auth.Append(RES+"\","); pHttpFile->AddRequestHeaders(auth); pHttpFile->SendRequest(); pHttpFile->QueryInfoStatusCode(m_dwStatusCode); pHttpFile->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, szHeaders); pHttpFile->Read(content, pHttpFile->GetLength()); } break;
default: break; } if(pHttpFile) {pHttpFile->Close(); delete pHttpFile; pHttpFile = NULL; } if(pHttpConnect) {pHttpConnect->Close(); delete pHttpConnect; pHttpConnect = NULL; } if(pSession) {pSession->Close(); delete pSession; pSession = NULL; } |
bit field와 컴파일러별 byte align (0) | 2017.03.27 |
---|---|
MFC CButton 마우스 클릭시 작동하기 (0) | 2017.03.08 |
만능의 tokenizer?! (0) | 2017.03.03 |
mfc md5 (2) | 2017.03.03 |
ms c++ 관련 신규 문법(?) (0) | 2017.03.03 |
HTTP 파싱하려는데
키와 값을 ,로 분리해서 쓰는녀석이라
고민을 해보는데.. 아무리 생각해도 토크나이저가 짱짱인듯
[링크 : http://stackoverflow.com/questions/12581169/cstring-tokenization-issue]
MFC CButton 마우스 클릭시 작동하기 (0) | 2017.03.08 |
---|---|
GetHttpConnection() (0) | 2017.03.03 |
mfc md5 (2) | 2017.03.03 |
ms c++ 관련 신규 문법(?) (0) | 2017.03.03 |
MFC HTTP POST + 인증 (0) | 2017.03.02 |
대부분이 오픈 라이브러리 사용하네..
순수하게 mfc 내부적으로 하는건 영 안보이는 듯..
[링크 : https://msdn.microsoft.com/en-us/library/windows/desktop/aa379908(v=vs.85).aspx] CryptCreateHash
파일내용을 md5로 만들기
[링크 : https://msdn.microsoft.com/en-us/library/windows/desktop/aa382380(v=vs.85).aspx]
[링크 : http://wwwi.tistory.com/90]
+
Cstring의 유니코드, ascii 변환
CStringA (아스키)
CString (유니코드)
[링크 : http://stackoverflow.com/questions/859304/convert-cstring-to-const-char]
대충 수정해서 만든 코드. 예외처리는 전부 빼버렸음
#include <Wincrypt.h> CString md5gen(CString input) { BYTE rgbHash[16]; BYTE *data; int data_len; DWORD cbHash; CString ret; CStringA str; HCRYPTPROV hCryptProv; HCRYPTHASH hHash; str = input; data = (BYTE *)str.GetString(); data_len = str.GetLength(); CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0); CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash); CryptHashData(hHash,(const BYTE *)data,data_len,0); CryptGetHashParam(hHash, HP_HASHVAL, rgbHash, &cbHash, 0); for (DWORD i = 0; i < cbHash; i++) ret.AppendFormat(_T("%02x"), rgbHash[i]); CryptDestroyHash(hHash); CryptReleaseContext(hCryptProv,0); return ret; } |
GetHttpConnection() (0) | 2017.03.03 |
---|---|
만능의 tokenizer?! (0) | 2017.03.03 |
ms c++ 관련 신규 문법(?) (0) | 2017.03.03 |
MFC HTTP POST + 인증 (0) | 2017.03.02 |
MFC HTTP GET/POST (0) | 2017.03.02 |
아직 정확한 위치는 모르겠으나
.net 관련 문법인듯?
gcnew야 new의 새로운 버전인거 같은데
저 망할(?) ^는 도대체 무어란 말인가 -_-
String^ str2 = gcnew String(str.c_str()); |
[링크 : https://kldp.org/node/99528]
[링크 : https://msdn.microsoft.com/en-us/library/ms235219.aspx]
The ref new aggregate keyword allocates an instance of a type that is garbage collected when the object becomes inaccessible, and that returns a handle (^) to the allocated object.
[링크 : https://msdn.microsoft.com/en-us/library/te3ecsc8.aspx]
만능의 tokenizer?! (0) | 2017.03.03 |
---|---|
mfc md5 (2) | 2017.03.03 |
MFC HTTP POST + 인증 (0) | 2017.03.02 |
MFC HTTP GET/POST (0) | 2017.03.02 |
win32 http 인증 관련 (0) | 2017.02.28 |
회사에서 쓸일이 있어서 정리했었는데
어라.. 블로그에는 안써놨었나 -ㅁ-?
[링크 : https://en.wikipedia.org/wiki/Digest_access_authentication]
[링크 : https://support.microsoft.com/ko-kr/help/195650/how-to-handle-proxy-authorization-with-wininet]
[링크 : http://blog.naver.com/bcknightt/220006031922]
[링크 : http://x68000.q-e-d.net/~68user/net/http-auth-2.html]
[링크 : http://blog.csdn.net/menglongbor/article/details/43713215]
HTML fieldset / legend (0) | 2017.05.26 |
---|---|
웹 페이지용 이미지 DB에 저장하기 (0) | 2017.04.21 |
http header (0) | 2017.03.02 |
HTTP GET / POST 차이 (telnet) (0) | 2017.02.06 |
해싱 salt (0) | 2017.01.27 |
http/1.0은 get만 보내도 됨
http/1.1은 host 필요
[링크 : http://serverfault.com/.../what-is-the-mandatory-information-a-http-request-header-must-contain]
[링크 : http://stackoverflow.com/questions/4726515/what-http-response-headers-are-required]
[링크 : http://stackoverflow.com/questions/6686261/what-at-the-bare-minimum-is-required-for-an-http-request]
웹 페이지용 이미지 DB에 저장하기 (0) | 2017.04.21 |
---|---|
http digest (0) | 2017.03.03 |
HTTP GET / POST 차이 (telnet) (0) | 2017.02.06 |
해싱 salt (0) | 2017.01.27 |
NPAPI / PPAPI - VLC ... (0) | 2016.01.14 |
digest 계산법
[링크 : https://social.msdn.microsoft.com/.../how-to-calculate-digest-auth-in-c?forum=vclanguage]
인증
[링크 : http://stackoverflow.com/.../how-do-i-make-an-http-post-with-http-basic-authentication-using-poco]
+
webrequest 클래스
[링크 : http://gyeongju.tistory.com/entry/SUNAPI-10-사용자인증-digest-인증방법-C]
[링크 : http://stackoverflow.com/questions/1907131/c-interface-version-of-httpwebrequest-and-httpwebresponse]
[링크 : https://msdn.microsoft.com/en-us/library/system.net.webrequest(v=vs.100).aspx]
+
[링크 : https://msdn.microsoft.com/en-us/library/windows/desktop/aa385351(v=vs.85).aspx]
mfc md5 (2) | 2017.03.03 |
---|---|
ms c++ 관련 신규 문법(?) (0) | 2017.03.03 |
MFC HTTP GET/POST (0) | 2017.03.02 |
win32 http 인증 관련 (0) | 2017.02.28 |
MFC / stdlib / qsort example (0) | 2016.12.19 |
[링크 : http://blog.naver.com/asiank/130105719167]
[링크 : http://blog.naver.com/chodadoo/220597496748]
[링크 : https://msdn.microsoft.com/ko-kr/library/cttkhz64.aspx] CInternetSession
[링크 : https://msdn.microsoft.com/en-us/library/0z6f3y99.aspx] CHttpConnection
[링크 : https://msdn.microsoft.com/en-us/library/0tw8chfe.aspx] CHttpFile
+
#include <afxinet.h> |
[링크 : https://social.msdn.microsoft.com/.../how-do-i-include-cinternetsession?forum=vcgeneral]
+
[링크 : https://www.codeproject.com/Articles/3253/Beginners-Intro-to-HTTP-calls]
ms c++ 관련 신규 문법(?) (0) | 2017.03.03 |
---|---|
MFC HTTP POST + 인증 (0) | 2017.03.02 |
win32 http 인증 관련 (0) | 2017.02.28 |
MFC / stdlib / qsort example (0) | 2016.12.19 |
MFC UpdateData() (0) | 2016.12.16 |
잠실에서 5호선 방향으로 가는 할아버지
웬지 눈에 들어왔는데 태극기와 성조기를 같이 들고 가시던 그분
도대체 어디로 멀하러 가는걸까...
생각을 해보니 천호 - 광화문 가시려던게 아닐까 싶긴하지만
도대체 성조기는 왜 들고 있는 걸까..??
그리고 둘러봐도 비가 와서 그런게 있을지도 모르지만
확실히 태극기가 눈에 띄지 않은 듯..
노인은 소비자? (0) | 2017.03.13 |
---|---|
탄핵 결정 - 만장일치 (2) | 2017.03.10 |
아놔.. ATM을 그럼 무료로 돌리던가, 창구를 늘리던가 (0) | 2017.02.14 |
이번 만큼은 잘못 판단한게 아닌가... 싶은데 (0) | 2016.12.28 |
진도 VTS 관련 의문점... (2) | 2016.12.27 |