C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted);
comm.Transaction =myTrans;
comm.CommandText="insert into TagInfo(TagID,AutoSubSysID,TagCode,TagName,TagType,TagValueType,TagMaxValue,TagMinValue,TagAlartMax";
comm.CommandText+=" ,TagAlartMin,TagSaveInterval,TagSaveIgBand,ValidTerm,TimeStampMode,TagAlartPos";
comm.CommandText+= ......
C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted);
comm.Transaction =myTrans;
comm.CommandText="insert into TagInfo(TagID,AutoSubSysID,TagCode,TagName,TagType,TagValueType,TagMaxValue,TagMinValue,TagAlartMax";
comm.CommandText+=" ,TagAlartMin,TagSaveInterval,TagSaveIgBand,ValidTerm,TimeStampMode,TagAlartPos";
comm.CommandText+= ......
C#中操作Oracle时的SQL语句参数的用法
OracleTransaction myTrans ;
conn.Open();
myTrans =conn.BeginTransaction(IsolationLevel.ReadCommitted);
comm.Transaction =myTrans;
comm.CommandText="insert into TagInfo(TagID,AutoSubSysID,TagCode,TagName,TagType,TagValueType,TagMaxValue,TagMinValue,TagAlartMax";
comm.CommandText+=" ,TagAlartMin,TagSaveInterval,TagSaveIgBand,ValidTerm,TimeStampMode,TagAlartPos";
comm.CommandText+= ......
using System;
using System.IO;
using System.Windows.Forms;
using Access = Microsoft.Office.Interop.Access;
// 添加引用->.NET-> dao,Microsoft.Office.Interop.Access
namespace WinFormAccess
{
public partial class FormAccess : Form
{
public FormAccess()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
string dbPath = Pa ......
using System;
using System.IO;
using System.Windows.Forms;
using Access = Microsoft.Office.Interop.Access;
// 添加引用->.NET-> dao,Microsoft.Office.Interop.Access
namespace WinFormAccess
{
public partial class FormAccess : Form
{
public FormAccess()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
string dbPath = Pa ......
C#与Flash交互 (转自小磊在线)
C#与Flash交互
前段日子公司要求做一个C#与Flash交互的东西,用来C#与短信猫通讯将数据传到Flash上显示与操作的应用。
第一步C#添加组件
打开VS2005-工具-选择工具箱项-COM组件-选择Shockwave Flash Object-确定
添加好组件往场景上拖放,如果提示注册需求注册
c# 注册控件-在运行输入-回车(flash9f.ocx这个文件以系统中实际文件为准。)
regsvr32 c:\windows\system32\macromed\flash\flash9f.ocx
或者regsvr32 c:\windows\system32\macromed\flash\flash10a.ocx
第二步将Flash组件拖入场景
将Flash组件拖入场景,设置加载的swf路径。设置组件id。
组件的Movie属性:指定要播放的swf的路径,
如果swf在本地硬盘,则需要写成 从盘符开始的绝对路径
如果swf在某网站上,则需要写成 完全的url网址
更多该组件属性/方法
第三步AS代码片段
刚开始用FSCommand与网页VBSCRIPT做了一个通讯,以为这样就能与C#通讯了,结果错误了。
还得用ExternalInterface.addCallback,ExternalInterface.call的方法来与C#通讯。
程序代码
import flash.external.*;
//向C#发送数 ......
C#与Flash交互 (转自小磊在线)
C#与Flash交互
前段日子公司要求做一个C#与Flash交互的东西,用来C#与短信猫通讯将数据传到Flash上显示与操作的应用。
第一步C#添加组件
打开VS2005-工具-选择工具箱项-COM组件-选择Shockwave Flash Object-确定
添加好组件往场景上拖放,如果提示注册需求注册
c# 注册控件-在运行输入-回车(flash9f.ocx这个文件以系统中实际文件为准。)
regsvr32 c:\windows\system32\macromed\flash\flash9f.ocx
或者regsvr32 c:\windows\system32\macromed\flash\flash10a.ocx
第二步将Flash组件拖入场景
将Flash组件拖入场景,设置加载的swf路径。设置组件id。
组件的Movie属性:指定要播放的swf的路径,
如果swf在本地硬盘,则需要写成 从盘符开始的绝对路径
如果swf在某网站上,则需要写成 完全的url网址
更多该组件属性/方法
第三步AS代码片段
刚开始用FSCommand与网页VBSCRIPT做了一个通讯,以为这样就能与C#通讯了,结果错误了。
还得用ExternalInterface.addCallback,ExternalInterface.call的方法来与C#通讯。
程序代码
import flash.external.*;
//向C#发送数 ......
public void SetWindowRegion()
{
System.Drawing.Drawing2D.GraphicsPath FormPath;
FormPath =
new System.Drawing.Drawing2D.GraphicsPath();
Rectangle
rect=new
Rectangle(0,22,this.Width,this.Height-22);//this.Left-10,this.Top-10,this.Width-10,this.Height-10);
FormPath = GetRoundedRectPath(rect, 30);
this.Region = new Region(FormPath);
}
private
GraphicsPath GetRoundedRectPath(Rectangle rect, int radius)
{
int diameter = radius;
Rectangle
arcRect = new Rectangle(rect.Location, new Size(diameter,
diameter)); &nb ......
之前不太喜欢C#,无意中发现linq,用来实现排序是如此简单,所以又用C#写了遍发牌程序
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//IEnumerable<string> expr = from s in cards
// where s.Length == 5
// &nbs ......
C#的功能很强大,却没有直接提供面向汉字文化的开发倾向
比如我现在要说的获取当前的星期我提供两种方法:
①,DateTime.Now.DayOfWeek ,查询MSDN可以知道该属性返回的结果是:
//
// 摘要:
// 获取此实例所表示的日期是星期几。
//
// 返回结果:
// 一个 System.DayOfWeek 枚举常数,它指示星期几。该属性值的范围从零(表示星期日)到六(表示星期六)。
public DayOfWeek DayOfWeek
{
get;
}
依据这个我们想见该属性提供了从星期日到星期六的位置,也就是说是枚举,枚举结合数组不就可以提取我们想要的数据了吗!代码如下:
public string Week()
&n ......