Skip to content

Instantly share code, notes, and snippets.

@messboy
messboy / SQL
Created January 15, 2014 09:21
//聯繫SQL 處理多筆SQL查詢
private void getmutiquery()
{
string cmdtext = "select top 10 * from Orders; select top 11 * from Products";
using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString))
{
SqlCommand cmd = new SqlCommand(cmdtext, conn);
SqlDataReader dr = null;
public enum Order
{
Ascending,
Descending
}
@messboy
messboy / Order.cs
Last active August 29, 2015 14:06 — forked from dinowang/Order.cs
public enum Order
{
Ascending,
Descending
}
@messboy
messboy / app.controllers.js
Last active September 13, 2015 09:17
2015/09/13 AngularJS模組練習
(function(){
angular.module('app')
.controller('MainCtrl', MainCtrl);
//明確相依性注入
MainCtrl.$inject = ['$scope', '$cookies', 'version', '$rootScope', 'Ipad1' , 'Ipad2', 'Ipad3', 'Ipad4'];
//如未加上面那段,此為隱含相依注入
function MainCtrl($scope, $cookies, version, $rootScope, Ipad1, Ipad2, Ipad3, Ipad4) {
@messboy
messboy / Faq.GetAll
Last active September 25, 2015 09:30
AuroraWebApi
[
{
"ID": "df046c2a-0347-4d3d-ba35-65d2aa351edb",
"Name": "問題faq2",
"Language": "中文",
"Category": "TEST Faq",
"Sort": 2,
"CreateTime": "2015-09-23T16:57:24.763",
"UpdateTime": "2015-09-23T16:57:24.763",
"TotalNum": 2
@messboy
messboy / calendar
Created September 18, 2015 16:22
calendar demo
<!--CSS-->
<link href="~/Content/fullcalendar.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<!--JS-->
<script src="~/Scripts/jquery-1.11.3.js"></script>
<script src="~/Scripts/moment.js"></script>
<script src="~/Scripts/fullcalendar.js"></script>
<script src="~/Scripts/bootstrap.js"></script>
@messboy
messboy / App.json
Last active September 21, 2015 07:18
教育雲&中研院交換格式
{
"lom": {
"general": {
"identifier": {
"catalog": "appgo",
"entry": "980"
},
"title": {
"string": "拯救地球"
},
// String arrays 三種宣告方式:
string[] arr1 = new string[] { "1", "2", "3" };
string[] arr2 = { "1", "2", "3" }; //匿名
var arr3 = new string[] { "1", "2", "3" };
string[] arr4 = new string[3];
arr4[0] = "1";
arr4[1] = "2";
arr4[2] = "3";
@messboy
messboy / NetWorkHelper
Last active February 16, 2016 02:14
html
public class NetWorkHelper
{
public static string GetPublicIP()
{
String direction = "";
WebRequest request = WebRequest.Create("http://checkip.dyndns.org/");
using (WebResponse response = request.GetResponse())
using (StreamReader stream = new StreamReader(response.GetResponseStream()))
{
direction = stream.ReadToEnd();
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="
====================================================================================================
${newline}
發生時間:${longdate} ${newline}
Logger:${logger} ${newline}
Log等級:${level:uppercase=true} ${newline}
request:${aspnet-request:serverVariable=url} ${newline}
sessionid:${aspnet-sessionid} ${newline}
ip:${aspnet-request:serverVariable=remote_host} ${newline}