當初開發時雖然也這麼覺得,但是那時 google了相關的資料找不到解決方案,就先放著不管
現在使用者提出來就逃不掉了
但是一樣 google了一整天,都沒有滿意的方案,無法從 Crystal Report的元件或設定等地方做調整
最後索性使用 js直接調整視窗大小
done
(該不會就是因為解決方案太簡單所以網路上都沒人詢問或分享吧 囧)
window.resizeTo(screen.width, screen.height)
window.resizeTo(screen.width, screen.height)
/*
TestDB 的部署指令碼
這段程式由工具產生。
...
*/
...
:setvar DatabaseName "TestDB"
:setvar DefaultFilePrefix "TestDB"
...
/* 偵測 SQLCMD 模式,如果不支援 SQLCMD 模式,則停用指令碼執行。
...
*/
...
sqlcmd -S TestDB -U userId -P password -i C:\TestDB_Update.publish.sql -o C:\output.txt
var result = '0,0.' + Array(decimalPlace + 1).join('0')
result = result.replace(/\.\s*$/, "");
decimalPlace 0: "0,0"<input type="button" value="Import" style="positionL fixed; z-index: 10000; top: 95%; left: 5px;" onclick="$('#importFile').click()" />
<input id="importFile" type="file" style="position: fixed; z-index: 10000l top: -100px; left: -100px;" onchange="Import(this)" />
function Import(fileInput) {
var reader;
if(window.File && window.FileReader && window.FileList && window.Blob) {
reader = new FileReader();
}
else {
return;
}
var txtContent;
if(fileInput.files && fileInput.files[0]) {
reader.onload = function (e) {
txtContent = e.target.result;
console.log(txtContent);
// Custom Code
// End of Custom Code
}
reader.readAsText(fileInput.files[0]);
//Reset
fileInput.value = '';
}
}
$('.modal').on('hide.bs.modal', function (e) {
if (CheckClosedByBtnOK()) {
if (!ValidInput()) {
e.preventDefault();
e.stopImmediatePropagation();
}
}
else {
ResetInput();
}
});
但是發現使用 datepicker選完日期並關閉小視窗後也會觸發 hide.bs.modal,導致每次選完值就還原,有選跟沒選一樣$('.modal').on('hidden.bs.modal', function (e) { ...
現在不會選完值就還原了,也就是 hidden.bs.modal只有在 modal關閉時才會觸發,datepicker關閉時不會hide.bs.modal | This event is fired immediately when the hide instance method has been called. |
hidden.bs.modal | This event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete). |
$('.modal').on('hide.bs.modal', function (e) {
console.log(this);
console.log('hide');
}).on('hidden.bs.modal', function (e) {
console.log(this);
console.log('hidden');
});
得出 hidden.bs.modal是在 modal被關閉後才觸發,所以 preventDefault當然沒有效果var isUsingDatepicker = false;
$('.modal').on('show.bs.modal', function (e) {
isUsingDatepicker = ($(div.datepicker-dropdown).length > 0);
}).on('hide.bs.modal', function (e) {
if (!isUsingDatepicker) {
if (CheckClosedByBtnOK()) {
if (!ValidInput()) {
e.preventDefault();
e.stopImmediatePropagation();
}
}
else {
ResetInput();
}
}
isUsingDatepicker = ($(div.datepicker-dropdown).length > 0);
});
<input class="A B" />
$('.A').keyup(function () {
...
});
$(document).delegate('.B', 'keyup', function () {
...
});
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
</configuration>
<configuration>
<!--logger: 記錄器,可自訂設定屬性(可多個)-->
<!--appender-ref: 指定參考的Appender設定-->
<logger name="Rolling">
<appender-ref ref="RollingFile" />
</logger>
<logger name="DB">
<appender-ref ref="LogDatabase" />
</logger>
</configuration>
<configuration>
<!--root logger: 根記錄器,當其他記錄器執行完後最後會執行根記錄器(唯一)-->
<!--level: 記錄級別設定-->
<root>
<level value="DEBUG" />
<appender-ref ref="RollingFile" />
</root>
</configuration>
For File
<configuration>
<!--appender: 內容為輸出格式的設定-->
<!--type: 輸出類型,例如 ConsoleAppender 為主控台輸出、RollingFileAppender 為文字檔輸出-->
<!--file: 輸出檔案的路徑位置-->
<!--layout: 記錄的格式設定-->
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="C:\Log\PlayLog.txt" />
<appendToFile value="true" />
<maximumFileSize value="1000KB" />
<maxSizeRollBackups value="2" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[Activity]%newlineActivityId: %property{GUID}%newlineTime: %date{yyyy-MM-dd HH:mm:ss}%newlineLevel: %level%newline%newline[System]%newlineSystem: %property{System}%newline%newline[IP]%newlineServerIP: %property{ServerIP}%newlineClientIP: %property{ClientIP}%newline%newline[Message]%newlineDescription: %property{Description}%newlineException: %property{Exception}%newline%newline[Properties]%newline%message%newline%newline" />
</layout>
</appender>
</configuration>
For DB
<configuration>
<appender name="LogDatabase" type="log4net.Appender.AdoNetAppender">
<bufferSize value="100" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=4.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="Data Source={Server};Initial Catalog={DBName};User ID={UserID};Password={Password}" />
<commandText value="INSERT INTO [dbo].[Message] (MessageId, Message) VALUES (@MessageId, @Message)" />
<parameter>
<parameterName value="@MessageId" />
<dbType value="Int32" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{MessageId}" />
</layout>
</parameter>
<parameter>
<parameterName value="@Message" />
<dbType value="String" />
<size value="100" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{Message}" />
</layout>
</parameter>
</appender>
</configuration>
3.Add Watch in Global.asax Application_Start()log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(Server.MapPath("~/log4net.config")));
log4net.ThreadContext.Properties["GUID"] = guidValue;
<parameter>
<parameterName value="@LogId" />
<dbType value="Guid" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="GUID" />
</layout>
</parameter>
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
</configuration>
<configuration>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\Log\log4net.txt"
/>
</listeners>
</trace>
</system.diagnostics>
</configuration>