PIXNET Logo登入

Samuel

跳到主文

Samuel's Blog

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 10月 12 週二 201017:31
  • Login failed for user in 'IIS APPPOOL'

environment:
web: asp.net for c#
db: sql server 2008
IIS: 7.5
(繼續閱讀...)
文章標籤

caramels 發表在 痞客邦 留言(0) 人氣(287)

  • 個人分類:ASP.Net For C#
▲top
  • 2月 03 週三 201018:51
  • using ADO.NET skill to operate the database - SQLDB

SQLDB
自己寫的ADO.NET class
使用C#
還蠻實用的
操作與講解都寫在
(繼續閱讀...)
文章標籤

caramels 發表在 痞客邦 留言(0) 人氣(590)

  • 個人分類:ASP.Net For C#
▲top
  • 1月 12 週二 201023:47
  • .NET AJAX的用法

本方法使用AjaxPro2
Step1
在web.config裡加入
<system.web>
    <httpHandlers>
      <add verb="POST,GET" path="Ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
    </httpHandlers>
</system.web>
(繼續閱讀...)
文章標籤

caramels 發表在 痞客邦 留言(0) 人氣(214)

  • 個人分類:ASP.Net For C#
▲top
  • 1月 03 週日 201014:22
  • 如何調閱控制項的event

using System.Reflection;
using System.ComponentModel;
PropertyInfo property = (typeof(控制項的類別)).GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic);
EventHandlerList ehList = (EventHandlerList)property.GetValue(控制項的ID, null);
此時ehList就如控制項裡base.Events的角色,可以讀取此控制項目前載入的事件
(繼續閱讀...)
文章標籤

caramels 發表在 痞客邦 留言(0) 人氣(96)

  • 個人分類:ASP.Net For C#
▲top
  • 10月 28 週三 200913:17
  • 抓遠端MAC兩種方法

1.使用CMD (不好用,且編譯在網站後無法使用)
using System.Diagnostics;
public string GetMac(string IP)
        {
            string str1 = String.Empty;
            try
            {
                string str2 = string.Empty;
                str2 = RunCmd("nbtstat -A " + IP);
                if (str2.ToLower().IndexOf("mac address", 0) > -1)
                {
                    str2 = str2.Trim();
                    str1 = str2.Substring(str2.ToLower().IndexOf("mac address", 0), 31);
                    str1 = str1.Remove(0, 14);
                    str1 = str1.ToUpper();
                }
                else
                    str1 = "";
            }
            catch
            {
                Response.Write("<Script>alert('抓不到')</Script>");
                str1 = "";
            }
            return str1;
        }
        public string RunCmd(string command)
        {
            //實例一個Process類,啟動一個獨立進程  
            System.Diagnostics.Process p = new System.Diagnostics.Process();
            string result = "";
            //Process類有一個StartInfo屬性,這個是ProcessStartInfo類,包括了一些屬性和方法,下面我們用到了他的幾個屬性:  
            p.StartInfo.FileName = "cmd.exe";           //設定程序名  
            p.StartInfo.Arguments = "/c " + command;    //設定程式執行參數  
            p.StartInfo.UseShellExecute = false;        //關閉Shell的使用 
            p.StartInfo.RedirectStandardInput = true;   //重定向標準輸入  
            p.StartInfo.RedirectStandardOutput = true;  //重定向標準輸出  
            p.StartInfo.RedirectStandardError = false;   //重定向錯誤輸出  
            p.StartInfo.CreateNoWindow = true;          //設置不顯示窗口  
            p.Start();   //啟動  
            //p.StandardInput.WriteLine(command);       //也可以用這種方式輸入要執行的命令  
            //p.StandardInput.WriteLine("exit");        //不過要記得加上Exit要不然下一行程式執行的時候會當機  
            //p.WaitForExit(1);
            //int Timeout=2;
            //while( Timeout > 0 && !p.HasExited)
            //{
            //    System.Threading.Thread.Sleep(1000);
            //    Timeout -= 1;
            //} 
            try
            {
                result = p.StandardOutput.ReadToEnd();
            }
            catch
            {
                result = "";
            }
            if (!p.HasExited)
            {
                p.Kill();
            }
            //强制关闭进程->無法成功
            //for (int i = 0; i < System.Diagnostics.Process.GetCurrentProcess().Modules.Count; i++)
            //{
            //    if (System.Diagnostics.Process.GetCurrentProcess().Modules[i].FileName.ToLower().IndexOf("cmd", 0) > -1)
            //     {
            //         string exeName = System.Diagnostics.Process.GetCurrentProcess().Modules[i].FileName;
            //         string[] exeArray = exeName.Split('\\');
            //         RunCmd("taskkill /im " + exeArray[exeArray.Length - 1] + " /f "); 
            //     }
            //}
            p.Dispose();
            p.Close();
            return result;        //從輸出流取得命令執行結果
        }
(繼續閱讀...)
文章標籤

caramels 發表在 痞客邦 留言(0) 人氣(1,455)

  • 個人分類:ASP.Net For C#
▲top
1

熱門文章

  • (492,668)準備TOEIC辛苦的一個月,進步了三百多分
  • (6,033)Javascript 是否為多執行緒(Multi-Thread) ?
  • (3,588)LDAP架設
  • (3,486)使用Hadoop架上自己的搜尋引擎nutch
  • (889)小港糖廠 - 紅豆酵母冰
  • (360)維力手打麵 - 蔥爆香牛
  • (134)MySQL 操作中文字碼的問題
  • (69)專業訓第十三週放假

文章分類

  • Web (1)
  • JavaScript (5)
  • 四健會 (5)
  • Google Map (0)
  • 雲端計算 (6)
  • OS (33)
  • ASP.Net For C# (5)
  • DB (6)
  • 好笑的笑話 (1)
  • 日記 (0)
  • 當兵生活 (49)
  • 生活雜事 (2)
  • strange news (0)
  • 生活小秘方 (8)
  • 食物 (50)
  • 逛街 (1)
  • 書本 (3)
  • 心情 (3)
  • 歌曲 (0)
  • 未分類文章 (1)

文章彙整

參觀人氣

  • 本日人氣:
  • 累積人氣:

最新迴響

  • [16/12/14] Judy 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    我也在準備多益。我的單字量很少,但是如果我只是拿單字書背單字...
  • [16/12/14] Judy 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    我也在準備多益。我的單字量很少,但是如果我只是拿單字書背單字...
  • [16/12/01] 訪客 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    這裡好多業配文......
  • [16/10/13] Vida 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    非常敬佩你的精神和專業! 恭喜你!...
  • [16/08/20] QQ 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    版大真的太強了 短時間就進步這麼多 辛苦換來的結果 以...
  • [16/08/13] 瑞瑞 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    版大您好~~ 我想要請問,您大部分的時間是不是都勤於做...
  • [16/08/02] lala 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    請問您推薦的這本書 書名是 : NEW TOEIC 聽力完全...
  • [16/04/13] 找面試經驗的路人 於文章「面試心得...」留言:
    請問一下部落主,您的日立是指台灣日立,還是底下的子公司(EX...
  • [16/03/25] 訪客 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    好厲害 欣賞版主的毅力...
  • [16/01/20] 無毒 於文章「準備TOEIC辛苦的一個月,進步了三百多...」留言:
    超棒的~~要向妳看齊...

test