This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpContent content; | |
var context = Request.Properties["MS_HttpContext"] as System.Web.HttpContextWrapper; | |
if (context != null) { | |
content = new StreamContent(context.Request.GetBufferlessInputStream(disableMaxRequestLength: true)); | |
content.Headers.ContentType = Request.Content.Headers.ContentType; | |
} else { | |
content = Request.Content; | |
} | |
await content.ReadAsMultipartAsync(provider); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web; | |
[assembly: PreApplicationStartMethod(typeof(Startup), "PreApplicationStart")] | |
public static class Startup | |
{ | |
public static void PreApplicationStart() | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Triangle | |
def self.hantei(a,b,c) | |
# 2辺を足した数が残り1辺"より小さい" | |
if(!(a < b + c && b < a + c && c < a + b)) | |
return '三角形じゃないです><' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http:// -H 'Content-type: application/x-www-form-urlencoded;charset=utf-8' -X POST -d "_method=patch" ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static readonly Char[] CHARS = new Char[] { | |
'a','b','c','d','e', | |
'f','g','h','i','j', | |
'k','l','m','n','o', | |
'p','q','r','s','t', | |
'u','v','w','x','y', | |
'z', | |
'2','3','4','5','6','7' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyCheckBox : CheckBox | |
{ | |
protected override void OnInit(EventArgs e) | |
{ | |
var _ = this.InputAttributes; | |
base.OnInit(e); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HRESULT __stdcall RegisterModule( | |
DWORD dwServerVersion, | |
IHttpModuleRegistrationInfo* pModuleInfo, | |
IHttpServer* pGlobalInfo | |
) { | |
::OutputDebugString ( TEXT("RegisterModule") ); | |
HRESULT hr = S_OK; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: ルートCAを作る | |
makecert -n "CN=MY CA" -pe -cy authority -r -sv "myca.pvk" "myca.cer" | |
:: 中間CA | |
makecert -n "CN=MY 2 CA" -pe -cy authority -iv "myca.pvk" -ic "myca.cer" -sv "my2ca.pvk" "my2ca.cer" | |
:: 証明書 サーバー : 1.3.6.1.5.5.7.3.1 クライアント : 1.3.6.1.5.5.7.3.2 | |
makecert -n "CN=対象の名前" -pe -eku 1.3.6.1.5.5.7.3.1 -sky exchange -sy 12 -iv "ca.pvk" -ic "ca.cer" -sv "my.pvk" "my.cer" | |
:: 作った証明書と秘密鍵は pvk2pfx.exe を使ってインストール用ファイルにする |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function func() | |
{ | |
param ( $msgfile, [int]$lev0, [int]$lev1, [string] $from, [string]$to, [datetime] $date) | |
$base = $spool | Join-Path -ChildPath $lev0 | Join-Path -ChildPath $lev1 | |
# メッセージ | |
$base | Join-Path -ChildPath "froz" | Join-Path -ChildPath $msgfile | Copy-Item | |
# ログ | |
$base | Join-Path -ChildPath "slog" | Join-Path -ChildPath $msgfile | Copy-Item -Destination "$msgfile.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: v3.5のwcfクライアントコードを生成する | |
:: レジストリを検索して %windowsSdkDir% を設定 | |
call "%VS100COMNTOOLS%VCVarsQueryRegistry.bat" 32bit No64bit | |
call set path=%windowsSdkDir%bin\NETFX 4.0 Tools;%windowsSdkDir%bin;%path% | |
:: ※HogeServiceフォルダには余分なファイルが無いこととする | |
:: ※サービス定義の既定の名前空間を Fuga.Piyo に変換する | |
svcutil /t:code "$(SolutionDir)etc\ServiceReference\HogeService\*.*" /async /noConfig /targetClientVersion:Version35 /namespace:http://tempuri.org/,Fuga.Piyo /out:HogeServiceProxy.cs /directory:"$(ProjectDir)ServiceProxy" |