事後想起才覺得可惜 忘了這間
先寫好 以便日後查詢...改名叫"魚乾的美食筆記本"好了
台北
墨西哥料理
佬墨日出-Tequila Sunrise
墨西哥餐飲美味道地,經典的仙格麗亞,順口的瑪格麗特,香脆玉米片搭配勁辣爽口瀟灑醬
義大利麵
La Pasta
中式熱炒
新東南活海鮮料理
鮮納肚~100元快炒店(東區)
require_once 'facebook.php';
echo "test
<script> function go(){
//xxx
}
go();
</script>";
Facebook.showPermissionDialog('publish_stream');
$(function(){ $('.floatBox').bind('drag',function( event ){ $( this ).css({ top: event.offsetY, left: event.offsetX }); //var pageCoords = "( " + e.pageX + ", " + e.pageY + " )"; //var clientCoords = "( " + e.clientX + ", " + e.clientY + " )"; }); });
$(function(){ $('.floatBox').live('drag',function( event ){ $( this ).css({ top: event.offsetY, left: event.offsetX }); }); });
//將form的透明鍵值設為一特定值
//方法1.圖中的10,10為透明鍵值
this.TransparencyKey = Img.GetPixel(10,10);
//方法2.直接指定顏色為透明鍵值
this.TransparencyKey = System.Drawing.Color.Transparent;//指定透明色
this.TransparencyKey = Color.Red; //或指定特定色
xxPanel.BackColor = System.Drawing.Color.Transparent;
//全域變數
int nOldWndLeft;
int nOldWndTop;
int nClickX;
int nClickY;
...
#region "GUI event"
//滑鼠按下的事件
private void pnlTitle_MouseDown(object sender, MouseEventArgs e)
{
nOldWndLeft = this.Left;
nOldWndTop = this.Top;
nClickX = e.X;
nClickY = e.Y;
}
//滑鼠拖曳事件
private void pnlTitle_MouseMove(object sender, MouseEventArgs e)
{
if (pnlTitle.Capture == true) //如果滑鼠按著拖曳
{
//'設定新的視窗位置
this.Top = e.Y + nOldWndTop - nClickY;
this.Left = e.X + nOldWndLeft - nClickX;
//更新紀錄的視窗位置
nOldWndLeft = this.Left;
nOldWndTop = this.Top;
}
}
#endregion
//建構子裡
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
SetStyle(ControlStyles.DoubleBuffer, true); // 雙緩衝
$result=api_client->data_createObject("tablename",array('name'=>123,'tel'='123456')); //回傳即$obj_id
api_client->data_updateObject($obj_id,$properties,$replace)
//css
a, input{
outline: none; /* for Firefox */
hlbr:expression(this.onFocus=this.blur()); /* for IE */
}
//html
<input type="text" style="hlbr:expression(void(0));">
<select id="test1" multiple="true"> //設multiple為true
//<option id='test1_opt1'>1</option>
...
//就不多寫了,不過得先為option取可識別的名字
</select>
var lastSelectedID=-1;
$("select#test1").change(function(){
var tmpLastSelectedID=-1;
jQuery('option:selected', this).each(function(){
//避開滑鼠直接選2個以上
if(tmpLastSelectedID>0){
$(this).attr("selected",false);
return true;
}
//避開ctrl點選
if (lastSelectedID==$(this).attr("id")){
$(this).attr("selected",false);
return true;
}else{
tmpLastSelectedID=id;
}
});
lastSelectedID=tmpLastSelectedID;
});
<link rel="stylesheet" type="text/css" media="screen" href="path_to_ui_css_file/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="path_to_jqgrid_css_file/ui.jqgrid.css" />
<script src="path_to_js_files/grid.locale-en.js" type="text/javascript"/></script/>
<script src="path_to_js_files/jquery.jqGrid.min.js" type="text/javascript"/></script/>
jQuery("#list4").jqGrid(
...
imgpath: gridimgpath //這行就不用了,拿掉
});
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/i18n/grid.locale-en.js" type="text/javascript"></script> <script src="js/jquery.jqGrid.min.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="css/ui-lightness/jquery-ui-1.7.2.custom.css" /> <link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" /> <script type="text/javascript"> $(function(){ jQuery("#list4").jqGrid({ datatype: "local", height: 250, colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Notes'], colModel: [ { name: 'id', index: 'id', width: 60, sorttype: "int" }, { name: 'invdate', index: 'invdate', width: 90, sorttype: "date" }, { name: 'name', index: 'name', width: 100 }, { name: 'amount', index: 'amount', width: 80, align: "right", sorttype: "float" }, { name: 'tax', index: 'tax', width: 80, align: "right", sorttype: "float" }, { name: 'total', index: 'total', width: 80, align: "right", sorttype: "float" }, { name: 'note', index: 'note', width: 150, sortable: false }], multiselect: true, caption: "Manipulating Array Data" }); var mydata = [{ id: "1", invdate: "2007-10-01", name: "test", note: "note", amount: "200.00", tax: "10.00", total: "210.00" }, { id: "2", invdate: "2007-10-03", name: "test2", note: "note2", amount: "300.00", tax: "20.00", total: "320.00" }, { id: "3", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", total: "430.00" }]; for (var i = 0; i <= mydata.length; i++) jQuery("#list4").addRowData(i + 1, mydata[i]); }); </script> </head> <body> <table id="list4" class="scroll" cellpadding="0" cellspacing="0"> </table> </body> </html>
a,input {
outline: none; /* for Firefox */
hlbr:expression(this.onFocus=this.blur()); /* for IE */
}
//在註冊表的HKEY_CURRENT_USER下建立AccountInfo資料夾及kevyu的鍵值
using Microsoft.Win32;
...
RegistryKey key = Registry.CurrentUser; //放在CurrentUser下
RegistryKey newkey = key.CreateSubKey(@"AccountInfo"); //在CurrentUser下建立AccountInfo資料夾
newkey.SetValue("kevyu", "ok1234"); //建立kevyu的密碼值 ok1234
//讀取值
RegistryKey mykey = key.OpenSubKey(@"AccountInfo", true);
Console.WriteLine("kevyu's password is " + mykey.GetValue("kevyu"));
<!-- 設定輪播框架外觀 -->
<style type="text/css">
.slideshow { height: 232px; width: 232px; }
.slideshow img { padding: 15px; border: 1px solid #ccc; background-color: #eee; }
</style>
<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://jquery.malsup.com/cycle/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.slideshow').cycle({
fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});
});
</script>
</head>
<body>
<!-- 將要播放的物件(img,span,... 啥都可以)放容器裡 -->
<div class="slideshow">
<img src="http://jquery.malsup.com/cycle/images/beach1.jpg" width="200" height="200" />
<img src="http://jquery.malsup.com/cycle/images/beach2.jpg" width="200" height="200" />
<img src="http://jquery.malsup.com/cycle/images/beach3.jpg" width="200" height="200" />
<img src="http://jquery.malsup.com/cycle/images/beach4.jpg" width="200" height="200" />
<img src="http://jquery.malsup.com/cycle/images/beach5.jpg" width="200" height="200" />
</div>
</body>
allow zero datetime=yes
動一下的感覺
onmouseover="this.style.padding='1px';"
onmouseout="this.style.padding='0px';"
//讓圖變透明
style="opacity:0.4;filter:alpha(opacity=80)"
onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100;"
onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80;"
Outlook.ApplicationClass app = new Outlook.ApplicationClass();
Outlook.MailItemClass mi = (Outlook.MailItemClass)app.CreateItem(Outlook.OlItemType.olMailItem);
mi.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
mi.To = "yurenju@gmail.com";
mi.Display(new object());
private void StartDefaultClient()
{
string filename = "mailto:jismenon@yahoo.com?subject=Hello&body=Hello&cc=meera@yahoo.com&bcc=jany@yahoo.com&Attach=@C:\\test.txt";
Process myProcess = new Process();
myProcess.StartInfo.FileName = filename;
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.RedirectStandardOutput = false;
myProcess.Start();
}
string[] myPicArrayTitle = new string[] { "Pic1", "Pic2"};
foreach(string title in myPicArrayTitle )
{
string strSQL = string.Format("Update PicInfo Set {0}=@{0} Where PicSN={1}", title, PicSN);
accessAdapter.MdbAccessOLE(strSQL , title,(byte[])dt.Rows[0][title]);
}
public bool MdbAccessOLE(string strSQL,string ColName ,byte[] FileByteArray)
{
this.my_StrConnection = "Provider=Microsoft.JET.OLEDB.4.0;data source=" + this.my_TablePath;
OleDbConnection my_conn = new OleDbConnection(this.my_StrConnection);
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = my_conn;
cmd.CommandText = strSQL;
cmd.Parameters.Add("@"+ColName, System.Data.OleDb.OleDbType.Binary, FileByteArray.Length).Value = FileByteArray;
bool result = true;
try
{
cmd.Connection.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
result = false;
SharedAPI.Log_Error("MDB操作失敗, 錯誤訊息:" + ex.Message + " SQL:" + strSQL);
}
finally
{
cmd.Connection.Close();
}
return result;
}
//直接執行,就是預設的browser
System.Diagnostics.Process.Start("http://www.google.com/");
//指定ie
System.Diagnostics.Process.Start("IExplore.exe", "http://www.google.com");
using Word = Microsoft.Office.Interop.Word;
SELECT * FROM `Record`
WHERE YEAR(`RecordDate`) = '2009'
AND MONTH(`RecordDate`) = '9'
//add 480 mins
Select DATE_ADD(RecordDate ,INTERVAL 480 MINUTE) as RecordDate From ...
//substract 30 days
`UpdateTime` Between DATE_SUB(NOW() ,INTERVAL 30 DAY) And NOW()
Select dateadd("n",480,RecordDate) as RecordDate From ...
dataGridView1.DataSource = DataTable;
foreach (DataGridViewRow dgv in dataGridView1.Rows)
{
row.DefaultCellStyle.BackColor = Color.Red; //改row的顏色
row.Cells["Col_AddUpdate"].Value = "新增"; //改內容值
}
private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
//在這裡改才有用
foreach (DataGridViewRow dgv in dataGridView1.Rows)
{
row.DefaultCellStyle.BackColor = Color.Red; //改row的顏色
row.Cells["Col_AddUpdate"].Value = "新增"; //改內容值
}
}
$("input[@name=go]").val(); //原本在 jQuery 1.2.x 上是可行的'
$("input[name=tag]").val(); //但1.3.x後要把@拿掉,不然會出錯
$(document).height();
$(window).height();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4>/strict.dtd">
/* * JavaScript * 找出cloudchen有幾個c */ var str = "cloudchen" var find = "c"; var reg = new RegExp(find,"g") var result = str.match(reg); var count = (result)?result.length:0; console.log('共:%d次',count);
//C#.Net System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(@"[:|\-| ]"); string datetime = "2009-01-02 03:04:05"; datetime = reg.Replace(datetime, ""); Console.WriteLine(datetime); //輸出20090102030405
.Net的Regex位於System.Text.RegularExpressions之下
$.blockUI({
message: $("#mydiv"),
draggable: true //加上這行囉
}
$.blockUI({
message: $("#mydiv"),
css: {
padding: 0,
margin: 0,
width: '30%',
top: '30%',
left: '25%',
color: '#000',
border: 'none',
cursor: 'auto'
}
width: '30%',
function focus(back){
...
e.focus(); <===這裡...
}
function focus(back){
...
try {
e.focus();
}catch (ex) {
$.unblockUI(); //抓解開block...至少畫面還可以操作
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
...
</html>
new ActiveXObject('WScript.Shell')).Run('test\\start.exe'); //執行位於test資料夾下的start.exe
[autorun]
OPEN=xxxx.exe
ICON=yyyy.ico //光碟畫面的icon
[autorun]
shellexecute=Setup.hta
var tbTitle = $("#tbRecordList").parent().prev();
$(tbTitle).find("tr:first").find("div").css("height","18"); //12pt字型適用
$("#tbRecordList tbody").css("cursor","pointer");
有兩種方法
1.$("#tablename").sortGrid('myname',true); //reload
//If the reload is set to true, the grid reloads with the current page and sortorder settings.
2.$("#tablename").setGridParam({sortname:'myname'}).trigger('reloadGrid');
jQuery("#tbRecordList").hideCol(["recordDate"]);
//setSelection(id,onsetselection) if true the event onSetRow is launched
jQuery("#tbRecordList").setSelection('1',true);
jQuery("#jqgh_test").attr("title", "This is title");
Application.ThreadException += new ThreadExceptionEventHandler(HandleException);
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(UnhandledException);
< a href="javascript:void(0);"> < img src="xx">
myProc.StartInfo.Arguments = "xx";
myProc.Exited += new EventHandler(myProcExit);
mt -manifest YourProgram.exe.manifest -outputresource:YourProgram.exe
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;
[StructLayout(LayoutKind.Sequential)] public class DEV_BROADCAST_PORT {
public int dbcp_size;
public int dbcp_devicetype;
public int dbcp_reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public char[] dbcp_name;
}
if (m.WParam.ToInt32() == DBT_DEVICEARRIVAL)
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WMI",
"SELECT * FROM MSSerial_PortName");
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\WMI",
"SELECT * FROM MSSerial_PortName Where InstanceName like '%VID_067B&PID_2303%'"); //這裡是利用Prolific做的驅動程式
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("MSSerial_PortName instance");
Console.WriteLine("Find Beacon at Port:{0}", queryObj["PortName"]);
Console.WriteLine("-----------------------------------");
}
regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE", true).OpenSubKey(@"SOFTWARE下的路徑", true);
//先引用Microsoft.Win32 using Microsoft.Win32; public bool findSoftwareInstalled() { try { //找PL-2303 USB-to-Serial 是否安裝 string path = "Prolific Technology INC\PL-2303 USB-to-Serial"; RegistryKey regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE", true).OpenSubKey(@path , true); if (regkey == null) { //"註冊表內無儲存安裝訊息"; return false; } else { //已安裝,可利用regkey.GetValue("xxx").ToString(); 取得相關資訊 return true; } } catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); return false; } }
using System.Management;
//要先在專案的參考加入System.Managementpublic bool getDrivers()
{
ManagementScope scope = new ManagementScope(@"root\CIMV2");
ObjectQuery query = new ObjectQuery("WQL", "SELECT * FROM Win32_SystemDriver");
ManagementObjectSearcher search = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection col = search.Get();
if (col.Count == 0)
{
return false;
}
Console.WriteLine("Win32_SystemDriver instance (Total Found:{0})", col.Count.ToString());
Console.WriteLine("-----------------------------------");
foreach (ManagementObject obj in col)
{
string driverlist = obj.ToString().ToUpper();
if (driverlist.Contains("SER2PL")) //此例是找SER2PL,更換你要的Driver Name
{
Console.WriteLine("找到Driver已安裝,Name: {0}", obj.ToString()); //name 是 Unique identifier for the service
return true;
}
/*
//印出所有屬性
foreach (PropertyData propertyData in obj.Properties)
{
ManagementBaseObject mbo = null;
if ((mbo = propertyData.Value as ManagementBaseObject) != null)
{
foreach (PropertyData prop in mbo.Properties)
Console.WriteLine("{0} - {1}", prop.Name, prop.Value);
}
}
* */
}
search.Dispose();
col.Dispose();
return false;
}
1.錯誤 無法發行,因為無法建置專案錯誤。
2.錯誤 必要條件的安裝位置沒有設定為「元件廠商的網站」,且磁碟上找不到項目 '.NET Framework 2.0' 中的檔案 'DotNetFX\instmsia.exe'。如需詳細資訊,請參閱 [說明]。
3. 錯誤 必要條件的安裝位置沒有設定為「元件廠商的網站」,且磁碟上找不到項目 '.NET Framework 2.0' 中的檔案 'DotNetFX\WindowsInstaller-KB893803-v2-x86.exe'。如需詳細資訊,請參閱 [說明]。
4.錯誤 必要條件的安裝位置沒有設定為「元件廠商的網站」,且磁碟上找不到項目 '.NET Framework 2.0' 中的檔案 'DotNetFX\dotnetfx.exe'。如需詳細資訊,請參閱 [說明]。
5.錯誤 必要條件的安裝位置沒有設定為「元件廠商的網站」,且磁碟上找不到項目 '.NET Framework 2.0' 中的檔案 'DotNetFX\langpack.exe'。如需詳細資訊,請參閱 [說明]。
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFX
1.錯誤 無法發行,因為無法建置專案錯誤。
2.錯誤 必要條件的安裝位置沒有設定為「元件廠商的網站」,且磁碟上找不到項目 '.NET Framework 2.0' 中的檔案 'DotNetFX\langpack.exe'。如需詳細資訊,請參閱 [說明]。
C#裡
/*
Code Snippet
Just add that piece of code (here in C#) in your main method (you need to
include the System.Diagnostic namespace) :
*/
Process currentProcess = Process.GetCurrentProcess();
Process [] allProcesses =
Process.GetProcessesByName(currentProcess.ProcessN ame);
if (allProcesses.Length > 1)
{
MessageBox.Show(currentProcess.ProcessName + " is already running !",
currentProcess.ProcessName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
//do your stuff here
}
VB
/*
Code Snippet
In the VB.NET application:
*/
Dim m As Mutex = _
New Mutex(False, "{11C92606-65D9-4df2-9AEA-B6A4DA91BCE2}")
If m.WaitOne(10, False) Then
Application.Run(New Form1())
m.ReleaseMutex()
Else
MessageBox.Show("Application already running!")
End If
/// <summary>
/// This will create a Application Reference file on the users desktop
/// if they do not already have one when the program is loaded.
// If not debugging in visual studio check for Application Reference
// #if (!debug)
// CheckForShortcut();
// #endif
/// </summary>
void CheckForShortcut()
{
ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;
if (ad.IsFirstRun)
{
Assembly code = Assembly.GetExecutingAssembly();
string company = string.Empty;
string description = string.Empty;
if (Attribute.IsDefined(code, typeof(AssemblyCompanyAttribute)))
{
AssemblyCompanyAttribute ascompany = (AssemblyCompanyAttribute)Attribute.GetCustomAttribute(code,typeof(AssemblyCompanyAttribute));
company = ascompany.Company;
}
if (Attribute.IsDefined(code, typeof(AssemblyDescriptionAttribute)))
{
AssemblyDescriptionAttribute asdescription = (AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(code, typeof(AssemblyDescriptionAttribute));
description = asdescription.Description;
}
if (company != string.Empty && description != string.Empty)
{
string desktopPath = string.Empty;
desktopPath = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "\\", description, ".appref-ms");
string shortcutName = string.Empty;
shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", company, "\\", description, ".appref-ms");
System.IO.File.Copy(shortcutName, desktopPath, true);
}
}
}
//驗證email格式 var pattern = new RegExp(); pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; if (!pattern .test(email)) { return false; //"email格式不對" }
pattern = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
var pattern = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,16}$/; //簡單點,不考慮英文大小寫 var pattern = /^(?=.*[a-zA-Z]+)(?=.*\d+).{6,16}$/;
< IFRAME SRC='gnagna.htm' STYLE='width:100%;'>< /IFRAME>