Posts
[JavaScript]HTML5 New Feature - Web Storage
<script> function OnLoad() { document.getElementById(“result”).innerHTML = checkWebStorageSupportable()?“Support”:“UnSupport”; }
function checkWebStorageSupportable() { return (typeof(Storage)!==“undefined”); } </script>
read morePosts
[Performance][C#]ToString V.S Enum.GetName
class Program { static void Main(string[] args) { var count = 1000000; Console.WriteLine("ToString: {0} ms", DoTest(count, () => { var temp = MyEnum.EnumItem1.ToString(); }).ToString()); Console.WriteLine("Enum.GetName: {0} ms", DoTest(count, () => { var temp = Enum.GetName(typeof(MyEnum), MyEnum.EnumItem1); }).ToString()); } static long DoTest(int count, Action action) { var sw = Stopwatch.StartNew(); for(int i = 0;i<count;++i) { action(); } return sw.ElapsedMilliseconds; } } } private static string InternalFormat(RuntimeType eT, object value) { if (eT.
read morePosts
[VB.NET]使用Make single instance application實現單一程式執行個體時所發生的怪現象
Private Sub Form1_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize If Me.WindowState = FormWindowState.Minimized Then NotifyIcon1.Visible = True Me.Hide() End If End Sub Private Sub NotifyIcon1_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick Me.Visible = True Me.WindowState = 0 '還原 Me.Activate() Me.TopMost = True NotifyIcon1.Visible = False End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load NotifyIcon1.Icon = Me.Icon End Sub End Class
Public Class Form1
read more