반응형

 

Ext

MIME Type

.doc

application/msword

.dot

application/msword

.docx

application/vnd.openxmlformats-officedocument.wordprocessingml.document

.dotx

application/vnd.openxmlformats-officedocument.wordprocessingml.template

.docm

application/vnd.ms-word.document.macroEnabled.12

.dotm

application/vnd.ms-word.template.macroEnabled.12

.xls

application/vnd.ms-excel

.xlt

application/vnd.ms-excel

.xla

application/vnd.ms-excel

.xlsx

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

.xltx

application/vnd.openxmlformats-officedocument.spreadsheetml.template

.xlsm

application/vnd.ms-excel.sheet.macroEnabled.12

.xltm

application/vnd.ms-excel.template.macroEnabled.12

.xlam

application/vnd.ms-excel.addin.macroEnabled.12

.xlsb

application/vnd.ms-excel.sheet.binary.macroEnabled.12

.ppt

application/vnd.ms-powerpoint

.pot

application/vnd.ms-powerpoint

.pps

application/vnd.ms-powerpoint

.ppa

application/vnd.ms-powerpoint

.pptx

application/vnd.openxmlformats-officedocument.presentationml.presentation

.potx

application/vnd.openxmlformats-officedocument.presentationml.template

.ppsx

application/vnd.openxmlformats-officedocument.presentationml.slideshow

.ppam

application/vnd.ms-powerpoint.addin.macroEnabled.12

.pptm

application/vnd.ms-powerpoint.presentation.macroEnabled.12

.potm

application/vnd.ms-powerpoint.presentation.macroEnabled.12

.ppsm

application/vnd.ms-powerpoint.slideshow.macroEnabled.12

출처 : http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx

반응형
반응형

ASP.NET MVC 1.0, 2.0 응용 프로그램의 샘플 프로젝트에서 AccountController 내의 Return Url 처리시

Return Url을 변조 가능성을 잠재하고 있다.

이러한 문제를 해결하기 위해서 아래의 코드를 통해서 Return Url을 체크를 꼭 해야한다.

MVC 3.0 이상부터는 UrlHelper 클래스안에 IsLocalUrl 이라는 메소드가 정의가 되어있으며, 샘플 코드에도 자동으로

적용이 되어있다.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;

namespace OpenRedirectionAttack.Code
{
    public class UrlHelperExtension
    {
        public bool IsLocalUrl(string url)
        {
            if (string.IsNullOrEmpty(url))
            {
                return false;
            }

            Uri absoluteUri;
            if (Uri.TryCreate(url, UriKind.Absolute, out absoluteUri))
            {
                return String.Equals(HttpContext.Current.Request.Url.Host, absoluteUri.Host, StringComparison.OrdinalIgnoreCase);
            }
            else
            {
                bool isLocal = !url.StartsWith("http:", StringComparison.OrdinalIgnoreCase) && !url.StartsWith("https://", StringComparison.OrdinalIgnoreCase) && Uri.IsWellFormedUriString(url, UriKind.Relative);
                return isLocal;
            }
        }
    }
}

반응형
반응형

IIS 7.5에서 지원하는 URL Rewrite

IIS 7.5에서는 URL Rewirte Module이 기본적으로 설치가 되어있지 않기 때문에

설치 파일을 다운 받아서 설치를 해야한다. 


Download : http://www.iis.net/download/urlrewrite


이번 포스팅에서는 단순히 HTTP 요청을 HTTPS로 Redirect 시키는 방법만 설명하겠다.

우선 설치가 완료 되면

  <rewrite>
     <rules>
         <rule name="Redirect to HTTPS" stopProcessing="true">
            <match url="(.*)" />
            <conditions>
               <add input="{HTTPS}" pattern="^OFF$" />
            </conditions>
            <action type="Redirect" url="https://{HTTP_HOST}" redirectType="SeeOther" />
         </rule>
     </rules>
  </rewrite>

이 코드를 Web.config의 <system.webServer> 구문 안에 포함시키면 된다.


너무 날로 먹나??

당연 IIS의 URL Rewirte에서 편한 UI를 통해서 원하는 패턴을 넣어서 설정할 수도 있다.

하지만 앞에서도 얘기했듯이 HTTPS로 Rewrite 시키는 방법만 알려주겠다는 것!!!





반응형
반응형


여러 각 브라우저에서 사용할 수 있는 CSS 코드를 생성해주는 CSS3 생성기 입니다.



http://css3generator.com/

반응형
반응형

요즘 웹개발 하시는 분 대부분이 jQuery를 많이 사용하고 계실겁니다.

저두 그렇구요^^

오늘 이 녀석 때문에 3시간 동안 삽질의 삽질을 했네요.

바로 문제의 부분은

<script href="common/jquery.1.4.1.min.js" type="text/javascript" />

뭐가 문제 일까요??

전 이렇게 선언을 하고 그 밑에

<script type="text/javascript">
        function methodCall()
        {
             alert("test");
         }
</script>

스크립트 호출문을 추가를 했지만

해당 페이지를 실행 시키면 methodCall()이란 함수가 정의가 되지 않았다는 스크립트 

오류만 뱉어내더군요. 므냐~!!

그렇게 스크립트 디버깅을 IE, FF 왔다갔다하면서 해봤지만 해결을 못했죠

결국 구글링~~~~~~~~~~~~~


앗!!! 충격적인 한마디

script tags can't be self-closing. You need a closing script tag:

What the.......!!!!!

이것은 
<script href="common/jquery.1.4.1.min.js" type="text/javascript"></script>

이렇게 해야지만 된다는거.... O.O

여태까지 난 jquery를 어떻게 쓰고 있었던거지..

아무튼 이 하나의 정보를 얻기 위해 근무시간 3시간을 날렸다 ㅡ _ㅡ 오호호호

야근 +3 추가요~!!!!!
반응형
반응형

ThinkPad X1 Carbon Gen 12 (21KC009BKR), WIN11 Pro, 16GB, 512GB, 블랙

Restart없이 IIS 재설정 하는 방법입니다.

 

ASP.NET Ver. 2.0에서 4.0으로 변경하기 위해서는

 

Command 창에서 닷넷 4.0이 설치가 되어있는 경로로 이동을 합니다.

 

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319/

 

 

우선 웹 서버의 Meta ID를 이용해서 변경이 가능합니다. Meta ID를 확인하기 위해서는 아래와 같은 명령어로

 

등록된 웹서버의 Meta ID를 확인 할 수 있습니다.

 

 

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis lk

 

  

 

 

그러면 웹서버의 재 시작 없이 ASP.NET의 버전을 변경하기 위해서는 아래의 명령을 실행시키시면 됩니다.

 

 

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -s w3svc/250310143/root -norestart

 

 

 

그러면 웹서버의 닷넷 버전이 4.0으로 변경되었음을 확인하실 수 있습니다.

 

 

 

 

참조 사이트 : http://www.mywindowsclub.com/resources/4487-How-change-NET-Framework-version-IIS.aspx

반응형
반응형

반응형
반응형

string currency = "USD" 


RegionInfo
regionInfo = (from culture in CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures)

                                 where culture.Name.Length > 0
                                 let region = new RegionInfo(culture.LCID)
                                 where String.Equals(region.ISOCurrencySymbol, currency, StringComparison.InvariantCultureIgnoreCase)

string currencySymbol = regionInfo.CurrencySymbol;


if currency = "USD" Then currencySymbol = "$"
if currency = "KRW" Then currencySymbol = "₩"
.......



화폐 약자를 입력하면 해당하는 화폐 심볼 기호를 얻게 되는 코드이다.

꽤 괜찮은 코드인듯.^^/

반응형

+ Recent posts