Programming

새글쓰기

peterlee.kr 메뉴 확장
1. 콘트롤러 생성 ex. CntanzController 2. Copy from another Controller and change the Prefix to CnTanz 3.Models 에 CntanzDBHandler.cs 와 CntanzModel.cs생성, copy 하고 마찬가지로 Prefix 바꾼다. 4.View에서도 CRUD카피하고 Prefix바꾼다. 5.App_Data에 Cntanz.json 생성하고 iis_user write속성 추가 6.CntanzController에 using peterlee.kr.Models;추가

미국 영국 Amazon에서 결제된 금액을 Payoneer를 통해 받을 수 있다고 하는데 어떤 과정이 필요한가? - [미결]
20210914 PAYCO로 부터 방금 들은 전화내용에 따르면 다음과 같다 PAYCO를 이용할 수 있는 방법은 두 가지, 첫 째 PAYCO에 직접 가맹점으로 가입해서 이용하는 법, 둘 째, 아임포트와 같은 제휴사를 통해 이용하는 방법이다. 둘 째의 경우에 있어 한 가지 의문은 KG이니시스에 연동된 결제창을 띠우면 PAYCO결제 항목 버튼이 있는데 그것을 아임포트가 연결해준다는 것인지 아니면 제휴한 PAYCO 와 탄쯔를 중간에서 연결하는 역할을 한다는 것인지가 의문이다.

1. How to adapt SSL to website? COMODO 90days free usage is a answer
<p> from : https://support.comodo.com/index.php?/Knowledgebase/Article/View/1160/19/csr-generation--microsoft-iis-8x </p> <p> <ul> <li>Comodo 사이트에 접속. 계정을 만들고 Free SSL Certificate 요청</li> <li> Comodo는 Provide your CSR을 요청한다.Certificate Signing Request라고 하는 이 CSR은 사용중인 서버의 종류에 따라 답이 다르다. 내 경우 Microsoft IIS를 사용중이므로 이에 적합한 대응을 한다. </li> </ul> </p> <h5>CSR Generation : Microsoft IIS 8.X</h5> <h7>출처: https://support.comodo.com/index.php?/Knowledgebase/Article/View/1160/19/csr-generation--microsoft-iis-8x</h7> <p>아래 그림을 참고하여 Server Certificates를 더블클릭</p> <img class="img-fluid" src="~/images/Miscellany/iis8-csr-1.png" /> <br /> <p>Create Certificate Request실행</p> <img class="img-fluid" src="~/images/Miscellany/iis8-csr-2.png" /> <br /> <p>아래 그림을 참고하여 해당 내용을 적는다.</p> <img class="img-fluid" src="~/images/Miscellany/iis8-csr-3.png" /> <br /> <p>아래 그림을 참고하여 선택하고</p> <img class='img-fluid' src='~/images/Miscellany/iis8-csr-4.png' /> <br /> <p> 아래그림과 같이 파일을 생성한다. 이 때 생성할 파일의 이름은 자신의 도메인이름으로 하는 것이 편리하다고 판단된다. 예를 들면 '도메인명.txt'하는 식으로. 이 때 도메인명은 물론 영문이 될 것이다. 이를 진행하면 해당 파일에 <br /> -----BEGIN NEW CERTIFICATE REQUEST----- MIIEZzCCA08CAQAwbTELMAkGA1UEBhMCS1IxDjAMBgNVBAgMBVNlb3VsMQ4wDAYD ~중략 WaOerZyouDw8gWiTBQY7oz/pSxU5kLgqeL9CiwVQ3DKY2vywLsv7JzNS9zU+5Ygc mhSsuoX3vGyPIgKnA9KQBzXXslue7EJyyHst -----END NEW CERTIFICATE REQUEST----- <br /> 와 같은 내용이 나오는에 이 내용을 COMODO의 요청난에 복사해 붙이면 FREE SSL을 취득할 수 있다. </p> <img class='img-fluid' src='~/images/Miscellany/iis8-csr-5.png' /> <p> 단 이 적용은 하나의 아이피에 하나의 인증서가 적용되는 점에 주의가 필요하다. 하나의 아이피에 여러 사이트를 운영하는 경우의 방법은 아직 발견하지 못함. </p>

GOGETSSL 얻을 때 MSIIS에서 2048 선택하는 것 잊지말 것
세 가지가 혼동되거나 기억나지 않는다. Create Certificate 할 때 2048 선택하기인데 디펄트가 1024이니까 이것을 바꾸어야만 했다. 그리고 두 개의 서버 중 선택한 서버의 Certificate를 신청한 것이므로 그 외의 서버를 관여할 필요 없다.

자동 우편번호 검색 및 주소입력 오류
popup에 동일한 주소, 예를 들면 www혹은 비www등 정확한 주소가 사용되어야 한다.

첫 째, 현금결제 or 카드결제, 둘 째,주문자 정보입력 유효성 검사
이 두 가지가 연동이 안되어 있으므로 이것 부터 해결해야 한다. 현재 asp:RadioButton으로 된 현금결제 카드 결제는 선택을 신용카드로 설정하였더라도 클릭을 하지 않으면 선택이 현금결제로 돌아간다. 이벤트가 없으므로. 이 이벤트는 cs파일에 있다. 따라서 체크하지 않았을 경우 오류 메시지 발송을 요한다.

Property value from code behind
https://stackoverflow.com/questions/5548812/i-want-to-get-property-value-from-code-behind

Curl을 ASP, ASPX, MVC 등으로 표현하기
PayPal과 Toss는 연동code를 Curl로 표기하고 있다. Curl을 내가 사용하는 언어로 바꾸어 표현해야하는데 방법은?

When select the Checks box or radios button, open, drop down another checks box or radios button
결제수단 선택에서 간편결제, 신용카드결제, 현금결제, 휴대폰결제 등이 있는데 예를 들어 현금결제를 누르면 은행을 선택하게 하는 메뉴가 나오게 하는 것.

윈도우 10 다시 시작 후 이전 작업들을 다시 뛰우기
https://mainia.tistory.com/6127 제어판setting->계정accounts-> 로그인옵션 Sign-in options 에서 앱 다시 시작Restart apps를 On ( Automatically save my restartable apps when I sign out and restart them after I sign on)

한글 처리
<%@Language="VBScript" CODEPAGE="65001" %> <% Response.CharSet="utf-8" Session.codepage="65001" Response.codepage="65001" Response.ContentType="text/html;charset=utf-8" %> 출처: https://as-one.tistory.com/entry/asp에서-euckr-utf8-설정-상단-구문 [AsOne블로그]

curl to C# converter -> https://curl.olsh.me/
Classic asp or curl로 쓰여져 있는 내용을 Razor 나 ASP.NET에서 사용하려고 하면 어떤 과정을 거쳐야 하나? 결제생성 curl https://pay.toss.im/api/v2/payments \ -H "Content-Type: application/json" \ -d '{ "orderNo":"1", "amount":10000, "amountTaxFree":0, "productDesc":"테스트결제", "apiKey":"sk_test_w5lNQylNqa5lNQe013Nq", "autoExecute":true, "resultCallback":"https://YOUR-SITE.COM/callback", "callbackVersion":"V2", "retUrl": "http://YOUR-SITE.COM/ORDER-CHECK?orderno=1", "retCancelUrl": "http://YOUR-SITE.COM/close" }' 의 내용을 ASP.NET혹은 Razor MVC에서 실행하게 한다고 하면 어떻게? 변환하면 // In production code, don't destroy the HttpClient through using, but better reuse an existing instance // https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/ using (var httpClient = new HttpClient()) { using (var request = new HttpRequestMessage(new HttpMethod("POST"), "https://pay.toss.im/api/v2/payments")) { request.Content = new StringContent("{ "orderNo":"1", "amount":10000, "amountTaxFree":0, "productDesc:"테스트결제", "apiKey":"sk_test_w5lNQylNqa5lNQe013Nq", "autoExecute":true, "resultCallback":"https://YOUR-SITE.COM/callback", "callbackVersion":"V2", "retUrl": "http://YOUR-SITE.COM/ORDER-CHECK?orderno=1", "retCancelUrl": "http://YOUR-SITE.COM/close" }"); request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json"); var response = await httpClient.SendAsync(request); } } var url = "https://pay.toss.im/api/v2/payments"; var httpRequest = (HttpWebRequest)WebRequest.Create(url); httpRequest.Method = "POST"; httpRequest.ContentType = "application/json"; 20211014 결과적으로 이 사이트의 변환방법을 결제 연동에 사용하지 않았다. var data = @"{ ""orderNo"":""1"", ""amount"":10000, ""amountTaxFree"":0, ""productDesc"":""테스트결제"", ""apiKey"":""sk_test_w5lNQylNqa5lNQe013Nq"", ""autoExecute"":true, ""resultCallback"":""https://YOUR-SITE.COM/callback"", ""callbackVersion"":""V2"", ""retUrl"": ""http://YOUR-SITE.COM/ORDER-CHECK?orderno=1"", ""retCancelUrl"": ""http://YOUR-SITE.COM/close"" }"; using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream())) { streamWriter.Write(data); } var httpResponse = (HttpWebResponse)httpRequest.GetResponse(); using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); } curl to C# converter https://curl.olsh.me/ Java / .Net String Escape / Unescape https://www.freeformatter.com/java-dotnet-escape.html#ad-output

[good website] Curl to C#/.NET ->https://reqbin.com/req/csharp/c-w7oitglz/convert-curl-to-http-request
https://reqbin.com/req/csharp/c-w7oitglz/convert-curl-to-http-request

application/json에 variable넣기 -> c# inserting variable in JSON string by escaping quotes ""id"": """+ idValue + @"""
변수 넣기 정답 https://stackoverflow.com/questions/14627935/c-sharp-inserting-variable-in-json-string-by-escaping-quotes string json = @" { ""Request"": { ""ElementList"": { ""id"": """+ idValue + @""" } } }";

HTTPS / 구매 인증서 관리 / GOGETSSL / 1년 마다 Reissue해서 재인증한 후 사용
인증서는 돈 주고 사거나 공짜로 얻을 수 있다. DNS server 와 IIS server를 사용한다. gogetssl.com으로 간다. 1. 90일짜리 무료 인증서 발급 - DNS server와 IIS server로 인증서를 등록하면 된다. 2. 유료 인증서의 경우 1년이 지나면 Reissue해서 다시 등록해서 사용해야하는 것으로 보인다.

MSSQL : select top 1 * FROM orderform2 order by num desc
select top 1 * FROM orderform2 order by num desc

Paging Json data [미결]
Paging Json data 이 웹사이트 peterlee.kr관리에 필요하다. https://forums.asp.net/t/1937892.aspx?Paginate+JSON+data

DB호스팅 DB이름 작명
현재 tanzseason3 tanzservicedb nopcommerce vnyartdb 이렇게 네 개를 사용중이다. 이름의 정리와 백업 정책에 필요한 추가 DB호스팅과 현재 적용된 이름이 혼란스러우므로 정리가 필요하다. 특히 새로운 홈페이지에 사용될 DB의 이름도 중요한 상황이다. 쉽게는 tanzseason4가 새홈페이지의 DB이름으로 사용되는 것도 무방하다.

결제하기에서 보내는 sms와 email
탄쯔 홈페이지에서 결제하기 클릭 시 보내는 sms와 email의 내용

Curl Windows 버젼 - windows10이상이라면 command Prompt에서 curl --help를 쳐보라. 이미 깔려 있다.
Windows 버전은 cygwin나 MinGW 로 빌드한거 보다는 VIsual Studio 로 빌드한 버전을 다운받는게 좋다. (Win32-Generic, Win64 - Generic 항목에서 받으면 되며 추천하는 링크는 https://winampplugins.co.uk/curl/ 이다.) 이게 무슨 말이야? windows10이상이라면 command Prompt에서 curl --help를 쳐보라. 이미 깔려 있다.

구 asp.net 에 namespace 추가하기
web.config에서 추가한다. System.Web에 add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" 와 같은 식으로 기록되어 있다.

구글링 - 오류 메시지 Feature 'interpolated strings' is not available in C# 5. Please use language version 6 or greater
결과 페이지 https://stackoverflow.com/questions/35686990/feature-interpolated-strings-is-not-available-in-c-sharp-5-please-use-languag 내용 Feature 'interpolated strings' is not available in C# 5. Please use language version 6 or greater

403 forbidden error after publish ASP.NET Core / .NET Core Publish Method / letsdance.kr로 실행하여보다.
403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. ANSWER visual studio application properties 에서 publish 과정을 거쳐야 한다. Publish과정 마지막에 Configure web server (IIS)connection이 있는데 target : 218.888.888.888 site name : letsdance.kr Destination URL : https://letsdance.kr User name : lballet Password : a1352612 로 했다. 이렇게 하면 안되고 ANSWER 폴더로 publish한다. 주소를 써주어야 하는데 해야 한다. 폴더 publish주소를 어디로 하느냐에 따라 앱의 폴더에 publish가 들어가기도 하고 그렇지 않기도 하다. 하지만 두 가지 다 작동이 된다. 어느것이 좋은지는 아직 잘 모르겠다. 하지만 해당 사이트의 폴더로 할 경우가 더 나은 거 같다. 가령 wwwroot폴더가 중복 생성되지 않는 점에서 적어도 그렇다. REFERENCE cmd dotnet --version https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-aspnetcore-3.1.6-windows-hosting-bundle-installer 주소로 가서 ASP.NET Core 5 와 3.16을 다운 받아 48서버에 설치하고 재실행한 후 iis가 정상작동하고 홈페이지를 볼 수 있다. BETTER ANSWER VS2019에서 솔루션 혹은 프로젝트를 만들고 물리적 주소 지정 Site_Folder Publish할 물리적 주소 지정 Site_Folder_Publish Publish할 때 Site_Folder_Publish로 Publish한다. 이로써 Site_Folder_Publish에 있는 것을 카피해서 어디로 가져가든 그것은 그 당시의 버전으로 실행이 된다.

SSL, www.letsdance.kr, letsdance.kr 브라우저에서 어느것을 치던 되게 하기. 그리고 물리적 주소는 하나로. 현재 탄쯔홈페이지가 이를 하지 못하고 있는 상황
www.tanz.co.kr과 tanz.co.kr인증서 두 개를 받아서 두개의 물리적 주소로 관리중이다. letsdance.kr의 경우 letsdance.kr인증서만 설치하고 letsdance.kr, www.letsdance.kr 두 가지 iis 상에서 binding 하여 하나의 주소로 클라이언트 단에서 실행이 가능하다. 클라이언트가 letsdance.kr을 치던 www.letsdance.kr을 입력하든 letsdance.kr의 물리적 주소는 하나다. 이제 잘못 관리중인 tanz홈페이지의 경우를 수정하려면 어떻게 하여야 할까? cn.tanz.co.kr이 완료되면 이것을 그런 식으로 적용해야 할 것이다.

dotnet core로 update하기
현재 사용중인 asp.net을 dotnet core로 바꾸어나가야한다. 과제와 해결책을 찾아야 한다.

REDIRECT www or non www
apple의 경우 apple.com, www.apple.com어느 것을 쓰더라도 www.apple.com으로 간다. 어떻게? 세팅해야 되나?

Redirect http to https AND non-www to www
IIS URL Rewrite QUESTION 서버에 인증서를 설치하고 https를 사용할 때 유저가 http://tanz.co.kr, http://www.tanz.co.kr, https://tanz.co.kr중 어떤 것을 웹에서 쓰더라도 https://www.tanz.co.kr로 오게 하는 것은 중요하다. 그렇게 하기 위해 IIS Server에서는 IIS URL Rewrite를 사용하면 된다. non-www를 www로 http를 https로 Rediriect 해주는 방법에 대한 답이다. https://stackoverflow.com/questions/32490426/iis-redirect-non-www-to-www-and-http-to-https

C# 모바일, pc, app, android, ios 분기
string u = Request.ServerVariables["HTTP_USER_AGENT"]; Regex b = new Regex(@"(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino", RegexOptions.IgnoreCase | RegexOptions.Multiline); Regex v = new Regex(@"1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-", RegexOptions.IgnoreCase | RegexOptions.Multiline); if ((b.IsMatch(u) || v.IsMatch(u.Substring(0, 4)))) //모바일이면 {}

[?] !IsPostBack in asp.net?
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // generate form; } else { //process submitted data; } }

[정보] curl 설치 to window server 2012 구형, build 1803번대 이전은 curl이 설치되어 있지 않다. 설치하는 방법. - 고로 그 이후 버전이나 윈도우10은 curl이 cmd에서 실행이 된다.
1.curl을 다운로드 받는다. 2.압축을 푼다 3.curl.exe (bin folder내) 만 해당 서버의 C:에 curl을 생성하고 여기에 카피 4.Go to http://curl.haxx.se/docs/caextract.html and download the digital certificate file named cacert.pem. The PEM file contains a bundle of valid digital certificates. The certificates are used to verify the authenticity of secure websites. They're distributed by certificate authority (CA) companies such as GlobalSign and VeriSign. The PEM file allows cURL to connect securely to the Zendesk API using the Secure Sockets Layer (SSL) protocol. Move the cacert.pem file to your C:\curl folder and rename it curl-ca-bundle.crt. 5. 그럼 curl폴더에 두 개의 파일 curl.exe와 curl-cs-bundle.crt가 있다. 6. 패쓰를 지정해준다. https://developer.zendesk.com/documentation/developer-tools/getting-started/installing-and-using-curl/#installing-curl 를 참고한다.

[tip] base64 encode in C# best site : https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=csaiur&logNo=220224658525
https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=csaiur&logNo=220224658525 C#에서는 System 네임스페이스의 Convert 클래스에서 기본적으로 Base64 문자열로 강제변환하는 메소드를 제공한다. 이는 다만 byte형식의 데이터만을 변환 가능하므로 문자열을 Base64로 변환하려면 문자열을 byte배열로 변환해서 사용해야 한다. 한글 문자열일 경우 텍스트인코딩 형식에 따라 깨짐현상이 발생할 수 있으므로 텍스트인코딩을 요즘 대부분 사용하는 UTF-8 형식으로 이러한 일련의 과정들을 사용하기 편리하도록 메소드로 구현 하였다. using System; namespace MyProject { public class SecurityUtil { #region Base64 public static string Base64Encode(string data) { try { byte[] encData_byte = new byte[data.Length]; encData_byte = System.Text.Encoding.UTF8.GetBytes(data); string encodedData = Convert.ToBase64String(encData_byte); return encodedData; } catch (Exception e) { throw new Exception("Error in Base64Encode: " + e.Message); } } public static string Base64Decode(string data) { try { System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder.GetDecoder(); byte[] todecode_byte = Convert.FromBase64String(data); int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); char[] decoded_char = new char[charCount]; utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0); string result = new String(decoded_char); return result; } catch (Exception e) { throw new Exception("Error in Base64Decode: " + e.Message); } } #endregion public static void Main(string[] args) { string testingStr = "가나다라마바사아자차카타파하"; string encodedStr = SecurityUtil.Base64Encode(testingStr); string decodedStr = SecurityUtil.Base64Encode(encodedStr); Console.WriteLine(encodedStr); Console.WriteLine(decodedStr); } } }

[정보] 가비아 SMS 메시징 서비스 단문 이용 REST API 로 하기 - 출처 https://sms.gabia.com/admin/api/
사용자인증->단문발송의 두 단계 1단계 : 사용자 인증 curl --location --request POST "https://sms.gabia.com/oauth/token" \ --header "Content-Type: application/x-www-form-urlencoded" \ --header "Authorization: Basic base64encode(SMS_ID:API_KEY)" \ --data "grant_type=client_credentials" 1단계의 벽은 base64encode(SMS_ID:API_KEY) 을 풀어쓰는 것이다. 이것은 세 가지를 알아야 한다. 첫 째 base64encode 에 대한 것이다. 둘 째, SMS_ID 및 API_KEY에 대한 자료가 어디에 있는가를 아는 것이다. 셋 째 curl로 얻은 정보를 split해서 access token을 분리해내는 것이다. 둘 째는 sms.gabia.com에 자신의 정보에서 확인할 수 있는 고정값이다. 첫 째의 base64encode는 프로그램적 지식을 필요로 한다. 여기에 대한 좋은 예는 Programming #30 을 참고한다. 셋 째의 경우는 json으로 전달된 코드를 분해하는 프로그램적 지식이다. 배열변수, split, replace를 사용할 수 있어야 한다. 2단계 : 단문(SMS )발송 curl --location --request POST "https://sms.gabia.com/api/send/sms" \ --header "Content-Type: application/x-www-form-urlencoded" \ --header "Authorization: Basic base64encode(SMS_ID:ACCESS_TOKEN)" \ --data "phone=01000000000&callback=15444370&message=SMS%20TEST%20MESSAGE&refkey=[[RESTAPITEST1549847130]]" 2단계의 벽은 1단계를 통과한 후 얻은 ACCESS_TOKEN을 Basic base64encode(SMS_ID:ACCESS_TOKEN) 에 적용하는 것이다. 이것은 1단계의 벽에서 넘은 첫 째 지식과 동일하다. 다음으로 data본문의 각 변수를 알아야 한다. phone // 받는 사람 전화번호 callback // 고정값 : sms.gabia.com 발신번호 1833-3401 message // 전달할 메시지 refkey //의미 없음 callback값은 sms.gabia.com에 등록한 환경과 동일한 발신 번호여야 한다. 다시 한 번 정리하자면 다음과 같다. 1. 사용자 인증 쿼리를 위해 SMS_ID와 API_KEY를 확인한다. 2. 이를 base64encode 한다. 3. 응답문에서 ACCESS_TOKEN을 분리 추출하고 이를 저장한다. 4. 저장한 ACCESS_TOKEN을 단문 발송 basic64encode(SMS_ID:ACCESS_TOKEN)에 적용한다. 5. 쿼리를 날린다. phone=01000000000&callback=15444370&message=SMS%20TEST%20MESSAGE&refkey=[[RESTAPITEST1549847130]] 이 때 callback에는 sms.gabia.com에 등록된 발신번호를 입력는 것에 주의한다. 여기 까지다. 주 변수는 다음과 같다. 한 번 더 확인한다. 상수 sms_id // 고정값 sms.gabia.com api_key // 고정값 sms.gabia.com callback // 고정값 sms.gabia.com 변수 이상의 상수를 이용해 받은 변수 ACCESS_TOKEN // 변수, 인증 값으로 시간에 따라 변한다. -끝- 추가. 이상을 적용해 클래스를 만든다.

Radio Button in mvc get value / What means input attribute name?
https://forums.asp.net/t/1924996.aspx?Radio+Button+in+mvc+get+value HttpPost public ActionResult YourAction(string YourRadioButton) { //Your Action Code Here } MVC will automatically post the value of your RadioButton (with the name "YourRadioButton") and map it to the parameter of the same name so that you could easily access it, however if you are not fond of actually including a parameter, you could always access it from the Request.Form object as you might in WebForms as well : var YourRadioButton = Request.Form["YourRadioButton"]; Using an HTML Helper Method An HTML Helper method such as Html.RadioButton will function the same exact way as mentioned above : @Html.RadioButton("YourRadioButton","A") @Html.RadioButton("YourRadioButton","B") What means input attribute name? cn.tanz.co.kr에서 결제방법을 선택할 때 Radio btn이면서 name은 PaymentMethodId로 되어 있는 것을 해석하기 위해서 한 질문이다. https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_name input type=text id=fname name=fname input type=text id=lname name=lname input type=submit value=Submit> Submitted Form Data Your input was received as: fname=Lee&lname=Byungil The server has processed your input and returned this answer.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=utf-8" --data-ascii "content=derinhält&date=asdf" http://myserverurl.com/api/v1/somemethod

MVC return RedirectToAction / return RedirectToAction("Action","controller", new {@id=id});
return RedirectToAction("Action","controller", new {@id=id});

How to migrate from WebForms to MVC, step by step?
https://stackoverflow.com/questions/36500355/how-to-migrate-from-webforms-to-mvc-step-by-step

MVC Routing Turn off for some folere
https://stackoverflow.com/questions/28853159/asp-net-mvc-disable-browsing-folders-allowing-access-to-aspx-files-without-s RouteTable.Routes.Remove(RouteTable.Routes["ROUTE NAME YOU WISH TO REMOVE"]); mvc method just go to url not controller and action https://cn.tanz.co.kr/PG/KGinicis/INIStdPayRequest.aspx%3fbank%3dCard%26tel%3d01036608471%26name%3d%EA%B9%80%EC%A0%95%EC%9D%B8%26totalprice%3d27500%26barre%3d https://cn.tanz.co.kr/PG/KGinicis/INIStdPayrequest.aspx?name=%EC%9D%B4%EB%B3%91%EC%9D%BC&handphone=01036608471&tel=01036608471&email=tanz@gmail.com&barre=solo%20barreinabag&totalprice=3300 https://cn.tanz.co.kr/PG/KGinicis/INIStdPayRequest.aspx?bank=Card&tel=01036608471&name=%EC%9D%B4%EB%B3%91%EC%9D%BC&totalprice=3400&barre=Duet&handphone=01036608471

Session, 장바구니, Cart의 이해
Shop - > Cart(장바구니) -> 비회원 회원 가입 -> 비회원구매 Cart/CheckoutNoneMember https://cn.tanz.co.kr/Cart?returnUrl=%2Fshop%2FSelectOption%3Fcategory%3DDuet

Model Binding in MVC [BEST YOUTUBE EXPLAINING] Model Binding in ASP.NET MVC Code Semantic, https://www.youtube.com/watch?v=cRWyEtMFDeg
public ActionResult NonMemberDeliveryInquiry([Bind(Include = "ShippingDetailId,Name,Email,CellularPhone,roadAddrPart1,addrDetail,InquiryContents")] MyAccountViewModel model, int ShippingDetailId) { // 정보변경을 원하는 회원의 id int id = ShippingDetailId; // 주문자정보변경을 요하는 내용 string nameNew = model.Name; string emailNew = model.Email; string cellularphoneNew = model.CellularPhone; Bind Include Exclude Prefix 등으로 다른 클래스 모델명을 지정해서 모델바인딩을 상호 교차 사용할 수 있다.

Linq Update
Update var mytab = db.Customers.First(g=>g.CustomerId == mymodel.CustomerId); mytab.FirstName = mymodel.FirstName; mytab.LastName = mymodel.LastName; db.SaveChanges(); Select var queryAllCustomers = from cust in customers select cust; var queryLondonCustomers = from cust in customers where cust.City == "London" select cust; var queryLondonCustomers3 = from cust in customers where cust.City == "London" orderby cust.Name ascending select cust; imageName = (from soh in db.tblProductImages where soh.product_id == e.ProductId select soh.image_name).FirstOrDefault() var ship =

소스코드중단점 설정
줄을 선택하고 F9 를 누르거나 디버그 > 중단점 설정/해제 를 선택하거나 마우스 오른쪽 단추를 클릭하여 중단점 > 중단점 삽입

[Javascript] Mobile page body onload 기능과 BODY onload에 여러 개 함수 걸어주기
body onload=함수명() window.onload=함수명(){} window.onload=function(){ function1(); function2(); }

Web Application Projects and Web Site Projects

Update mac mini mac os Monterey
apple Logo > 시스템 환경 설정 선택, 소프트웨어 업데이트 클릭, 더 이전 버전의 macOS를 사용 중인 경우에는 App Store를 이용합니다.

SSL www and non-www URL Rewrite / moveit.kr, www.moveit.kr 어느 것을 쓰더라도 https://www.moveit.kr로 가게 하기
1.GOGETSSL을 www.moveit.kr로 구매한다. 2.IIS 에서 Bindings에서 http://moveit.kr https://moveit.kr http://www.moveit.kr https://www.moveit.kr 모두를 등록하고 https의 경우 GOGETSSL에서 구매한 SSL을 https://moveit.kr과 https://www.moveit.kr 모두에 설정하고 3.URL Rewrite를 설정한다. 방법은 실제 등록한 www.moveit.kr을 참고할 것.

sass
Sass is a CSS pre-processor. Sass reduces repetition of CSS and therefore saves time. /* Define standard variables and values for website */ $bgcolor: lightblue; $textcolor: darkblue; $fontsize: 18px; /* Use the variables */ body { background-color: $bgcolor; color: $textcolor; font-size: $fontsize; }

Bootstrap icons cdn, https://icons.getbootstrap.com/
address : link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" 를 기록하고 아래처럼 사용한다. i class="bi bi-alarm"

Bootstrap 이미지위에글얹기 how to put the text on image in bootstrap
이건 특별한 답이 보이지 않는다. 어떤 개인이 해 놓은 다음 방법이 가장 효과적으로 판단된다. https://stackoverflow.com/questions/59839349/correct-way-to-add-text-over-an-image-in-bootstrap-3 .banner { position: relative } .banner img { width: 100% } .banner .container { position: absolute; left: 0; right: 0; top: 50%; text-align: left; transform: translateY(-50%) }

모바일에서 세로 이미지가 길어보이게 하기, 원래 정사각형이었으나. How to adjust to the aspect ratio for mobile browser
change image ratio from desktop to mobile in bootstrap https://developer.mozilla.org/ko/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images 해상도 전환 문제(resolution switching problem) 해답이 되는 사례 페이지 https://mdn.github.io/learning-area/html/multimedia-and-embedding/responsive-images/responsive.html

mapbox.com 가입 peter@barreina~, aA1~2!

Bootstrap 5 기초 동영상 강좌 : https://www.youtube.com/watch?v=4sosXZsdy-s
탄쯔 홈페이지 만드는 기초가 된 동영상임. https://www.youtube.com/watch?v=4sosXZsdy-s

Image Size Info, dimensions and displayed, keep image quality problem
웹페이지를 만들 때 이미지 퀄리티가 중요하다. 이미지 퀄리티는 사진의 품질과 함께 페이지가 보여지는 데스크탑과 모바일의 화면 해상도와 밀접한 연관이 있다. mobile display의 경우 Retina방식은 두 배의 이미지를 사용해야한다고 한다. 레티나디스플레이의 특성 때문이다. 웹페이지에서 보여지는 이미지와 해상도가 일치하는 것이 우선 중요하다. 이미지는 w:2000, h:1000인데 데스크탑에서 img src로 들여진 화면 displayed가 w:1000, h:500이라면 이미지는 찌그러짐 현상이 발생한다. 그 반대의 경우에는 픽셀이 뭉게져 벌어지는 현상이 발생할 것이다. 결국 dimensions과 displayed가 1vs1을 이루는 것이 핵심이다. 이를 도와주는 크롬 브라우져의 앱이 있다. chrome에 이를 해결하기 위한 앱이 있다. image size info가 그것이다. https://chrome.google.com/webstore/detail/image-size-info/oihdhfbfoagfkpcncinlbhfdgpegcigf?hl=ko 에서 설치할 것 개요: 모바일과 데스크탑에 최상/적정한 이미지 퀄러티 보장하기 데스크탑의 해상도에 대한 이해, 4k모니터 모바일의 해상도에 대한 이해, 620p ppi에 대한 이해 1 points = 1.333 pixel Best Image Sizes and How to Save Images For the Web and Flothemes https://flothemes.com/flothemes-image-sizes/

Customize Bootstrap
to add scss file 아래에 유익한 정보가 있다. https://blog.hubspot.com/website/how-to-override-bootstrap-css 이 정보에 의하면 To change Bootstrap is not recommended. 유지가 어려워지게 된다는 점에서 첫 째 customize한 내용을 파악하기가 어렵다. 둘 째 Bootstrap 새 버젼으로의 upgrade가 힘들어진다 따라서 이보다는 The good news is there's a way to make changes without editing the Bootstrap source code. 제시안은 override Bootstrap CSS :원래의 코드를 놓아 둔 체 custom code in an external stylesheet 현재의 style에 override 혹은 추가해서 사용하는 것이다.

Zencoding
예전에 신기하게 생각했던 것. 1. Visual Studio 2019 toos extention에서 zencoding 설치 2. 설치 후 쓰고 탭 키 누르면 된다 div#idname div.classname table>tr>td zencoding HTML Elements https://code.google.com/archive/p/zen-coding/wikis/ZenHTMLElementsEn.wiki

CSS units for font-size: px | em | rem / https://nekocalc.com/px-to-rem-converter
CSS에서 글자, font-size를 정확하게 이해하기 위해 단위를 먼저 이해하여야 한다. 그것은 px, em, rem이다. rem rem values are relative to the root html element, not to the parent element. em is by parent element px를 쓰면 불편한 이유 px Pixels are the easiest measurement to use. But there is a catch. Let’s say we used pixels throughout our website and we managed the media queries too. What if a user changes the default font-size of browser (or device)? Your header’s font-size (say 20px) will remain 20 px. Hence user’s font preferences won’t be reflected. Which is not a good user experience. So, pixels may be good at spacing and layout but are not good fit for font-size. ems and rems are at rescue. CSS units for font-size: px | em | rem https://medium.com/@dixita0607/css-units-for-font-size-px-em-rem-79f7e592bb97 Pixel to REM, https://nekocalc.com/px-to-rem-converter https://www.croydon.gov.uk/design-and-content-guidelines/resources/pixel-rem-conversion-table

bootstrap을 사용하여 웹페이지 작성중에 브라우저 y scrollbar가 사라졌다

Bootstrap, 문단글 Desktop에서 Mobile로 변할 때 줄 바뀜 현상이 원래의 디자인에 영향을 덜 주게 하는 방법이 있을까?
1320 width에

bootstrap padding-left조정 px단위 가능할까?
답1 There's nothing like that in Bootstrap, but in CSS, just use the code div { margin-left:20px; }

Horizontal scroll menu
https://iamsteve.me/blog/horizontal-scrolling-responsive-menu

px to rem, rem to px
https://nekocalc.com/px-to-rem-converter https://www.croydon.gov.uk/design-and-content-guidelines/resources/pixel-rem-conversion-table

Bootstrap Flexbox, https://www.youtube.com/watch?v=JJSoEo8JSnc

Using Gmail SMTP to Send Emails from your Website
https://u.expressionengine.com/article/using-gmail-smtp-to-send-emails-from-your-website

flex box에 대한 아주 좋은 설명
https://www.freecodecamp.org/news/understanding-flexbox-everything-you-need-to-know-b4013d4dc9af/

Sticky MENU
https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_navbar_sticky

미디어쿼리를 사용할 때 클래스 혹은 아이디 CSS의 순서가 중요하다.
데스크탑에서는 글꼴이 16픽셀로 모바일에선 12픽셀로 보이도록 한다. .ts1216px{ font-size:16px; } .ts1216px{ @media (min-width:768px){ font-size:12px; } } 이 순서로 CSS를 적어주면 .ts1612px 클래스를 만났을 때 screen이 768px 이하일 경우 위에 것이 유지 되면서 아래 것은 무시할 것이다. 만약 768px보다 크면 아래 것을 사용하게 된다.

Horizontal Scrolling in Web Design: How to Do It Well
https://blog.hubspot.com/website/horizontal-scrolling

Bootstrap Carousel의 완벽한 이해 동영상
https://www.youtube.com/watch?v=gor5BvT2z88

Responsive Product Slider
https://www.youtube.com/watch?v=-pLICdm7bPE

JavaScript DOM Crash Course-Part1
https://www.youtube.com/watch?v=0ik6X4DJKCc JavaScript에 대한 nice한 설명 이거 4편 까지 있다 꼭 볼 것 https://www.youtube.com/watch?v=mPd2aJXCZ2g https://www.youtube.com/watch?v=wK2cBMcDTss https://www.youtube.com/watch?v=i37KVt_IcXw

Linq 식에 변수 사용하기
Linq를 모르고 사용한다.

Flex box
좋은설명 https://poiemaweb.com/css3-flexbox 전체 레이아웃은 flexbox 적용 중 flex-container와 flex-item속성 bootstrap과 flexbox 의 관계 bootstrap row와 flexbox 의 관계는 flexbox는 언제 사용하는가? https://css-tricks.com/snippets/css/a-guide-to-flexbox/#prefixing-flexbox flex box Container : -flex-direction(row, row-reverse, column, column-reverse) -flex-wrap(wrap, nowrap) -flex-flow는 flex-direction 과 flex-wrap을 둘 다 지정할 수 있다. ex) flex-flow : flex-direction속성값, flex-wrap속성값 - justify-content ( flex-start, flex-end, center, space-between, space-around, space-evenly) - align-items (flex-start, flex-end, center, stretch, baseline) - align-content (flex-start, flex-end, center, stretch, space-between, space-around) - gap, row-cap, column-gap flexbox items -order -flex-grow -flex-shrink -flex-basis -align-self ( auto, flex-start, flex-end, center, baseline, stretch) ex) flex: none | flex-grow, flex-shrink, flex-basis This is the shorthand for flex-grow, flex-shrink and flex-basis combined. The second and third parameters (flex-shrink and flex-basis) are optional. The default is 0 1 auto, but if you set it with a single number value, it’s like 1 0.

CaptchaMVC.Mvc4 to Tanzmac homepage , https://www.c-sharpcorner.com/UploadFile/bd8b0b/how-to-implement-captcha-in-Asp-Net-mvc/

letter-spacing 에는 em이 좋다.
출처 : https://blog.hyungsub.com/entry/%ED%95%9C%EA%B8%80-%EC%9B%B9%ED%8F%B0%ED%8A%B8-%EC%9E%90%EA%B0%84letter-spacing-%EC%9E%90%EB%8F%99%EC%9C%BC%EB%A1%9C%EC%83%81%EB%8C%80%EC%A0%81%EC%9C%BC%EB%A1%9C-%EC%A1%B0%EC%A0%95%ED%95%98%EA%B8%B0 CSS의 경우 한글 폰트를 대상으로는 letter-spacing을 보통 -1px ~ -2px로 주는 것이 일반적입니다. 다만 이 경우 폰트 사이즈가 커지는 경우에 값을 다르게 설정해 주어야 하는 것과 같은 불편이 있습니다. 텍스트가 커져도 동일한 비율로 자간이 좁아지는 방법이 있으면 더욱 편하게 작업이 가능할 것입니다. 이럴 때를 대비해서 em 유닛을 쓰는 것을 저는 추천드립니다. 특히 적용 scope를 em 유닛을 통해서 전체 개체에 적용하게 함으로써 시간을 절약할 수 있습니다. 16px를 본문 기본 폰트 사이즈로 산정할 경우 1/16인 0.0625em를 이용하면 -1px의 효과를 전체 텍스트에 적용할 수 있습니다. 값을 더 늘려야 하는 경우 2/16 또는 1/14 등의 산술을 통해서 값을 변화시킬 수 있습니다. em은 자신 또는 직계 부모 개체의 font-size 값을 바로 상속받아 동일한 배율로 값을 산정하는 단위입니다. rem은 문서의 기본 폰트 사이즈만을 상속받으므로 여기에서의 사용은 다소 부적절합니다.

Database 관리 어떻게?
사이트 네임 : www.cityballet.com 데이터베이스 네임 : cityballetDB 하는 식

POSTMAN curl in the web / web.postman.co/onboarding/user 구글 탄쯔코리아 계정으로 로그인할 것
Postman 사용법 https://nhj12311.tistory.com/393

지메일을 SMTP로 사용하려면 단계를 조정해라, 여기서. https://myaccount.google.com/lesssecureapps
이 주소로 가면 자신의 지메일 단계를 설정할 수 있다. 한글로 보안수준이 낮은 앱의 액세스라고 되어 있다. 보안수준이 낮은 앱 허용: 사용으로 되어 있어야 지메일을 자신의 웹어플리케이션에서 메일을 보내는 smtp로 사용할 수 있다.

NULL CHECK C# - how to check null values using if condition in C#

Cookie and Session in Browser
How to use cookie and session? 쿠키(Cookie)란? / https://nesoy.github.io/articles/2017-03/Session-Cookie 웹 서버가 브라우저에게 지시하여 사용자의 로컬 컴퓨터에 파일 또는 메모리에 저장하는 작은 기록 정보 파일입니다. 파일에 담긴 정보는 인터넷 사용자가 같은 웹사이트를 방문할 때마다 읽히고 수시로 새로운 정보로 바뀔 수 있습니다. 쿠키(Cookie) 단점 쿠키에 대한 정보를 매 헤더(Http Header)에 추가하여 보내기 때문에 상당한 트랙픽을 발생시킵니다. 결제정보등을 쿠키에 저장하였을때 쿠키가 유출되면 보안에 대한 문제점도 발생할 수 있습니다. Session의 등장 배경 쿠키의 트래픽 문제와 쿠키를 변경하는 보안적 이슈를 해결하기 위해 등장하였습니다. 세션(HTTP Session)이란? HTTP Session id를 식별자로 구별하여 데이터를 사용자의 브라우저에 쿠키형태가 아닌 접속한 서버 DB에 정보를 저장 합니다. 클라이언트는 HTTP Session id를 쿠키로 메모리 저장된 형태로 가지고 있습니다. 메모리에 저장하기 때문에 브라우저가 종료되면 사라지게 됩니다. What? 접속한 서버DB에 정보를 저장한다고, 그리고 메모리에 저장하기 때문에 브라우저가 종료되면 사라진다고?

Bootstrap ICON, chevron 등 https://icons.getbootstrap.com/

로그인, 이메일 확인 및 암호 재설정, 이메일 2단계인증 관련 글
https://docs.microsoft.com/ko-kr/aspnet/mvc/overview/security/create-an-aspnet-mvc-5-web-app-with-email-confirmation-and-password-reset https://docs.microsoft.com/ko-kr/aspnet/mvc/overview/security/aspnet-mvc-5-app-with-sms-and-email-two-factor-authentication Email confirmation in ASP.NET mvc5 without sendgrid https://stackoverflow.com/questions/28127841/email-confirmation-in-asp-net-mvc5-without-sendgrid

SCSS compile with Web Compiler
Compile Sass Files in Visual Studio 2019 Using Web Compiler https://andyp.dev/posts/compile-sass-files-in-visual-studio-2019-using-web-compiler

ASP.Net Identity how to set target DB?
검색어 : asp.net identity database connect https://docs.microsoft.com/en-us/aspnet/mvc/overview/security/create-an-aspnet-mvc-5-web-app-with-email-confirmation-and-password-reset https://docs.microsoft.com/en-us/aspnet/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity#build

분리가 답
구역을 정하는 것. 오오피도 그 일환. 페이지도 그렇고. 가능한 한 잘게 부수고 의존성을 적게 하는 것 각자가 하나의 객체가 되어 빛을 발하게 하는 것이 프로그래밍에서도 매우 중요하다는 사실을 알게 됐다.

HOW TO SAVE & DISPLAY HTML CONTENT IN ASP.NET MVC5
HTML콘텐트를 어떻게 MSSQL에 저장하고 읽을 것인가 MVC5에서 create and read html tag from mssql in mvc 2. HTML Encode 하기 ("<" → "&lt;") string encodeStr = HttpUtility.HtmlEncode(">") 3. HTML Decode 하기("&lt;" → "<") string decodedStr = HttpUtility.HtmlDecode("&lt;"); 4. 예제 using System.Web; ... string str = "&, <, >, \" "; Debug.WriteLine("Original String : " + str); // Encode the string. string encodedStr = HttpUtility.HtmlEncode(str); Debug.WriteLine("Encode String : " + encodedStr); // Decode the encoded string. string decodedStr = HttpUtility.HtmlDecode(encodedStr); Debug.WriteLine("Decode String : " + decodedStr); 출처: https://wpfstory.tistory.com/12 [WPF Story]

LINQ TO SQL 좋은 설명
https://www.c-sharpcorner.com/UploadFile/3d39b4/simple-select-insert-update-and-delete-using-linq-to-sql/

The entity type ApplicationUser is not part of the model for the current context. 오류 https://stackoverflow.com/questions/23893710/the-entity-type-applicationuser-is-not-part-of-the-model-for-the-current-context 해답
Answers 72 I was having this same problem. I’m doing database first development with an EDMX file. If you are using the connection string generated when adding the EDMX file in :base(“EDMXConnString”) you will most likely have this problem. I fixed this by creating a standard connection string that pointed to the database where the ASP.NET Identity tables are.

.net core publish

zencoding visual studio 2019에서 사용하려면 extetions 메뉴에서 Web Essentials 2019를 다운로드 받아 설치한다.

GA, Google Analytics, 구글 어낼러틱스
2022 01 18 cs@tanz.co.kr에서 구글어낼러틱스를 사용하고 있다.

https://www.wordtune.com/ 계속 쓰기
grammary와 비슷한 영역 사이트 쿠키세션 지우면 무한 사용 가능

객체지향 설계 8 단계 과정
1.적합한 분석 수행 2.시스템을 설명하는 작업명세서 개발 3.작업명세서에 따른 요구사항수집 4.사용자인터페이스를 위한 원형개발 5.클래스 확인 6.각 클래스의 책임 역할 결정 7.다양한 클래스가 상호작용하는 방법 결정 8.구축할 시스템을 설명하는 상위 수준 모델 작성

Html.DropdownList 의 value or text를 javascript get하기
1. Html.DropdownList란? 2. HtmlHelper란 MVC View 에서 HTML을 손쉽게 생성하기 위해 Html Helper를 제공하고 있다. Html Helper는 모두 @Html로 시작하는데 @는 Razor문법이며View Class(WebViewPage)의 Html 속성을 호출한다는 의미이다. 일반 HTML대신 HtmlHelper를 사용하면 좋은 때는 모델 데이터 혹은 View 데이타를 바인딩 할 때 유리하다. HtmlHelper는 크게 (1)Html.TextBox()와 같은 형태의 Weakly Typed메서드와 (2)Html.TextBoxFor()와 같은 For로 끝나는 Strongly Typed메서드로 구분할 수 있다. (1) Html.TextBox("Name", null, new {@class="form-control"} (2) Html.TextBoxFor(m =>m.message , new{@class = "form-control} 위 (1)의 첫 번 째 파라미터 Name은 Name속성이다. 두 번 째 파라미터 null은 텍스트 박스의 값인데 null로 지정하면 Guest.Name속성을 표시한다. null이 아닌 문자열을 지정하면 지정한 문자열 값을 반환한다. 세 번 째 파라미터는 attributes이다.

plain, vanilla AJAX 로 비회원 배송비 적용하기
비회원이 주소를 적으면서 자신의 국가를 선택하면 배송비 UPS 가 상품별로 더해지도록 하기 - 배송업체 : UPS - 배송비 : UPS의 지역구분 1, 2, 3, 4, 41, 5 지역과 해당 지역의 국가들이 상품의 무게에 따라 가격이 결정된다 - 상품 : 탄쯔 상품 각각에 지역에 따른 가격을 미리 명기하였다. 이것은 사실 무식한 방법이다. 상품의 무게 컬럼이 상품 테이블에 있다면 이것을 참고해 가격이 결정되게 하는 것이 바람직할 것이다. 예를 들면 CountryOfCustomer 테이블에 지역 코드, UPSRegionCode가 있으므로 이것을 참고하고 무게를 참고해 무게별 UPS 가격 테이블에 별도로 만들어 사용하는 것이다. 그렇다면 TanzProduct테이블에 upsPriceRegion1, upsPriceRegion2.. 등과 같은 여섯개의 컬럼이 생기지는 않았을 것이다. 어쨌든 위와 같은 정보를 기반으로 비회원이 주소를 적으면서 국가를 선택하면 Delivery Price가 Final Payment Information에 더해지도록 하는 것이 현재의 목표다. 이 목표는 아래 checkDeliveryPrice.js로 정리 완료됨 [checkDeliveryPrice.js의 내용] //20220228 CheckoutNoneMember.cshtml에서 사용자가 국가를 선택하면 배송비가 결정되게 하기 // 1. Id를 가져온다 var CountryOfCustomerId = document.getElementById('CountryOfCustomerId'); // 2.option 선택으로 id 넘버와 국가명을 가져온다. 두 개의 id를 네이밍하고 변수 생성 // id number에 해당 var selectedCountryValue; // 국가명에 해당 var selectedCountryText; // 3.이것은 없어도 되는 것인데 편의상 document.getElemntById()에 해당하는 변수를 생성한 것이다. var optionSelectedCountryValue = document.getElementById('idSelectedCountryValue'); var optionSelectedCountryText = document.getElementById('idSelectedCountryText'); // var deliveryPrice = document.getElementById('idSelectedDeliveryPrice'); CountryOfCustomerId.addEventListener('click', function () { selectedCountryValue = CountryOfCustomerId.options[CountryOfCustomerId.selectedIndex].value; selectedCountryText = CountryOfCustomerId.options[CountryOfCustomerId.selectedIndex].text; optionSelectedCountryValue.textContent = selectedCountryValue; optionSelectedCountryText.textContent = selectedCountryText; //document.getElementById('idSelectedDeliveryPrice').innerHTML = 'hello 200'; // 여기서부터 plain ajax를 적용한다. 20220301 var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://www.barreinabag.com/Cart/GetUpsRegionCode/' + selectedCountryValue, true); xhr.onload = function () { if (this.status == 200) { console.log(this.responseText); //document.getElementById('idDeliveryPrice').innerHTML = this.responseText; //document.getElementById('idSelectedDeliveryPrice').innerHTML = this.responseText; //document.getElementById('idSelectedDeliveryPrice2').innerHTML = this.responseText; var words = (this.responseText).split(','); // 반환값을 ','로 나눈다. 반환값은 ups code, 배송비, 배송비를 합한 총액이다 document.getElementById('idSelectedUpsCode').innerHTML = words[0]; document.getElementById('idDeliveryTotalPriceByCountryAndSelectedProduct').innerHTML = words[1]; //배송비 document.getElementById('idNoneMemberTotalPriceWhenSelectedCountry').innerHTML = words[2]; // 배송비를 합한 총액 document.getElementById('RealPayment').value = words[2]; // 넘어가는 실제 금액 배송비를 합한 총액으로 바꾼다. document.getElementById('idSeeDollarSign').classList.remove("d-none"); document.getElementById('idSeeDollarSign2').classList.remove("d-none"); document.getElementById('idSeeDeliveryPrice').classList.remove("d-none"); document.getElementById('idDeliveryPrice2').innerHTML = words[1]; } else if (this.status == 404) { console.log('Wrong'); } } xhr.send(); // 여기까지가 ajax 실행부다 });

Best AJAX YOUTUBE, AJAX & XHR Crash Course - https://www.youtube.com/watch?v=82hnvUYY6QA
https://www.youtube.com/watch?v=82hnvUYY6QA is best for AJAX

doing Javascript SDK of PayPal after selecting country javascript
문)두 번 째 클릭은 안되는건가? CheckoutNoneMember에서 select해서 국가를 선택하면 배송비와 배송비를 포함한 상품금액이 산출된다. 이후 PayPal버튼으로 배송비를 포함한 상품금액을 운용하려고 버튼을 클릭하면 PayPal Script amount {value: } 답)아니 된다 hidden 이 문제였다. input type='hidden'의 경우 자바스크립트 사용시 보이지 않을 뿐 아니라 계산에서도 null이 된다. 두번 째 클릭도 된다. 페이팔 버튼을 누르면 실행이 된다. 그리고 span 태그의 경우 innerText로 가져와야 한다. PayPal javascript를 사용할 경우 다시 한 번 총정리해보자. 1. javascript의 경우 header로 와야 한다. script src=https://www.paypal.com/sdk/js?client-id=..." /script Is loading after you try to render the buttons, so the paypal object doesn't exist when the button tries to render. You need to ensure the script loads before you try to render the buttons, i.e. it needs to appear first on the page. One way to do this is to load the resource from head 2. In my case, selecting country makes the total price to pay for the customer, so after selecting country, the total price will be determined, at the moment the final price is determined by javascript checkDeliveryPrice.js. And then, PayPal javascript SDK is on the line waiting for pay. When click the PayPal btn. paypal.Buttons createOrder: function (data, actions) return actions.order.create purchase_units: amount: //value: document.getElementById('idDeliverPricePlusProductPrice').value value: document.getElementById('idNoneMemberTotalPriceWhenSelectedCountry'.innerText //value: @cartdata.ComputeTotalValue().ToString() //위에 있는 총액을 여기에 넣었다. 원화를 달라로 1200으로 나누어. onApprove: function (data, actions) return actions.order.capture().then(function (details) alert('Transaction completed by ' + details.payer.name.given_name); .render('#paypal-button-container // Display payment options on your web page are working. In this working 'value: document.getElementById('idNoneMemberTotalPriceWhenSelectedCountry').innerText' is the answer. Wrong doing was input type="hidden" id="idDeliverPricePlusProductPrice" value="" It must be changed input type="text" id="idDeliverPricePlusProductPrice" value="" Because the type styles of input are hidden and text, hidden means null to javascript, so it makes fault. So the type text makes correct work for javascript. Seeing is the answer for HTML.

C# MVC Model Binding Column Number, 아울렛 판매 상품을 만들면서 생긴 문제 해결 - 미결, 이 문제는 아울렛 구매의 경우에도 마일리지와 쿠폰 적용하기로 결정.
아울렛 상품을 추가하면서 아울렛의 경우 쿠폰과 마일리지가 적용되면 안되는 문제를 해결하려고 하면서 생긴 문제. 아울렛 상품을 소비자가 선택하면 회원의 경우라도 쿠폰 마일리지는 무효가 되게 처리한다. 상품에 아울렛 상품이 섞여 있다는 것을 알려면 line.TanzProduct.ProductName의 모든 배열을 합하고 그 안에 Outlet이라는 글자가 하나라도 있으면 쿠폰과 마일리지를 무효화한다. 어떻게 배열을 합하고 그 안에 Outlet이라는 글자가 있는 것을 확인할 것인가?

amazon Payoneer Card Re-Registration
How to

MVC5 Razor Syntax에서 radio 유효성 검사
Example: Html.RadioButtonFor() in Razor View Copy @model Student @Html.RadioButtonFor(m => m.Gender,"Male") Html Result: input checked="checked" id="Gender" name="Gender" type="radio" value="Male"

Razor foreach 에 사용된 Javascript -각 데이터에 맞게 값을 가져오기 - 해결
Razor foreach 문 안에 즉, foreach (var item in Model)로 루프를 돌리고 해당 값을 가져오고 여기서 각 해당 값을 페이지에 뿌려주는데 문제는 첫 값만 인식하고 해당값들은 가져오지 못하는 문제. 이것은 onmouse btn을 누른 해당 a href에 @explanation과 같은 item in Model값이 적용되어야 하는 것이다. btn과 상관 없는 위치에 있을 경우 첫 번 째 값만 인식이 된다. 해당 버튼과 관계 없이 있으므로.

Mobile 가로로 넘어가고 아래에 줄 생기는 현상 / 꽉 차지 않고 넘어가는 이미지가 생기는 현상
Mobile 가로가 불완전한 현상의 원인은?

스크롤 바 사라짐 현상
스크롤 바가 왜 사라지는지. css때문인 듯. 부분 삭제를 하면서 테스트 하여 해결한다. css에 scrollbar customize의 설정으로 인한 문제였다. webkit-scrollbar 값을 css에서 지정하는 식의. ::-webkit-scrollbar { display: none; }

split을 사용예, 탄쯔맥홈페이지 사례 카로우젤에서 다른 식으로 바꾸기 썸네일사진이 보이고 썸네일사진 위로 마우스 올라가면 사진이 바뀌는 식
20230526 item에서 datas테이블의 picture, picture1, picture2, picture3, picture4, picture5, picthure6 이렇게 일곱 개의 데이터가 있다. 여기에 사진 이름 파일명을 쓰고 동일한파일명_1.jpg부터 동일한파일명_6.jpg 까지 일곱개의 사진 파일을 넣을 수 있다. 하지만 유감스럽게도 난 picture column에는 그동안 사진자료를 넣지 않았다. 지금 쓰는 이 규칙에 대한 글 조차도 나중에 기억이 가물거릴 수 있을 것이다. 따라스 직접 row data table값 datas를 MSSQL 로 직접 열어보고 데이터를 일일이 보며 사진 데이터를 어떻게 넣었는지 알게 돼었다. 향후 데이터베이스를 이용한 프로그램 제작시에는 이러한 규칙에 대한 부분을 미리 지정한 후 지켜나가는 식으로 정리가 되어야 할 것이다. 자 우선 기존의 것을 활용하기 위해서는 item.picture1의 값을 가져오고 여기서 마지막 부분 .jpg를 중심으로 split한 string 배열값을 토대로 프로그래밍 적용한다. chatGPT의 split을 활용하면 다음과 같다. string picture = item.picture1; //여기서 item.picture1은 어떤파일명_01.jpg로 구성되어 있을 것이다. string[] substrings = picture.split('.'); // 이렇게 하면 .을 중심으로 어떤파일명_01.jpg를 어떤파일명_01과 jpg 이렇게 두 개의 substrings를 얻는다. 이 때 substrings[0]이 어떤파일명_01이 될 것이다. substrings[1]은 jpg가 될 것이다. 그런데 여기서 얻고자 하는 값은 어떤파일명_01 즉 substrings[0]을 다시 1을 중심으로 구분하는 것이다. 그동안 규칙을 적용해 쓴 파일명을 보면 대개 다음과 같다. 샘플1 무용마루20190829-서울서교동-Assemble-EREA_신이안-6.jpg 무용마루20190829-서울서교동-Assemble-EREA_신이안-5.jpg 무용마루20190829-서울서교동-Assemble-EREA_신이안-4.jpg 무용마루20190829-서울서교동-Assemble-EREA_신이안-3.jpg 무용마루20190829-서울서교동-Assemble-EREA_신이안-2.jpg 무용마루20190829-서울서교동-Assemble-EREA_신이안-1.jpg 샘플2 20181103-사당동개인연습실-1.jpg 20181103-사당동개인연습실-2.jpg 20181103-사당동개인연습실-3.jpg 20181103-사당동개인연습실-4.jpg 20181103-사당동개인연습실-5.jpg 20181103-사당동개인연습실-6.jpg 샘플3 20230519_서울공연예고01.jpg 20230519_서울공연예고02.jpg 20230519_서울공연예고03.jpg 20230519_서울공연예고04.jpg 샘플1과 샘플2의 경우라면 .으로 split한 후 -을 토대로 다시 한 번 split을 하면 될 듯 하긴 하다. 안타깝게도 샘플3에서는 이러한 규칙이 무너졌다. 따라서 향후 파일명 규칙을 지정하고 이를 지킬 필요가 있다.

Bootstrap 으로 Mobile과 Desktop 에서 선별적으로 보이게 하기
모바일에서 class="d-block d-md-none" / Bootstrap 기법 데스크탑에서 class="d-none d-md-block" / Bootstrap 기법

Wonderful GhatGPT3.5 , What means these codes, row row-cols-2 row-cols-lg-3 g-2 g-lg-3?
These codes are part of the Bootstrap grid system and are used to define the layout and spacing of elements within a grid. Let's break down each part: row: This class is used to define a row in the Bootstrap grid system. Rows are containers that hold columns, and they help in creating a horizontal alignment for the columns. row-cols-2: This class is used to specify the number of columns that should appear in a single row on small screens. In this case, it indicates that there should be 2 columns in a row on screens of small size and larger. row-cols-lg-3: This class is similar to row-cols-2, but it sets the number of columns for large (lg) screens. It indicates that there should be 3 columns in a row on screens of large size and larger. g-2: This class sets the gutter (spacing) between columns in a row on all screen sizes. The number (2 in this case) represents the size of the gutter. It's a shorthand for gap-2. g-lg-3: Similar to g-2, this class sets the gutter size, but specifically for large (lg) screens. It indicates that there should be a larger gutter size on screens of large size and larger.