///<summary>
/// 獲取枚舉屬性
///</summary>
///<param name="e"></param>
///<returns></returns>
publicstaticString GetEnumDesc(Enum e)
{
FieldInfo EnumInfo = e.GetType().GetField(e.ToString());
DescriptionAttribute[] EnumAttributes = (DescriptionAttribute[])EnumInfo.
GetCustomAttributes(typeof(DescriptionAttribute), false);
if (EnumAttributes.Length > 0)
{
return EnumAttributes[0].Description;
}
return e.ToString();
}
publicclassEnumStringHelper
{
publicstaticstring getString(object o)
{
Type t = o.GetType();
string s = o.ToString();
DescriptionAttribute[] os = (DescriptionAttribute[])t.GetField(s).GetCustomAttributes(typeof(DescriptionAttribute), false);
if (os != null&& os.Length == 1)
{
return os[0].Description.ToString();
}
return s;
}
}
///<summary>
/// 深拷貝
///</summary>
///<param name="value">原拷貝對象</param>
///<returns>新拷貝對象</returns>
T DeepCopy<T>(T value)
{
T temp = default(T);
try
{
MemoryStream ms = newMemoryStream();
BinaryFormatter bf = newBinaryFormatter();
bf.Serialize(ms, value);
ms.Seek(0, 0);
temp = (T)bf.Deserialize(ms);
ms.Close();
}
catch
{ }
return temp;
}
dbcc checkident(‘表名’,reseed,0)
更改powerDesigner的默認數據庫引擎(Unable to list the table的解決辦法。)
菜單 database -〉 change current dbms 。本文地址
用PowerDesigner逆向數據庫工程時”Unable to list the table"錯誤的解決方法。
“SP_DBCMPTLEVEL”存儲過程來正確設置數據庫的版本兼容。知道原因后解決故障就很簡單了,打開企業管理器,輸入“EXEC SP_DBCMPTLEVEL 'DataBaseName', '90'; GO ”并執行,執行成功后,重新逆向工程就可以了。 PS: SP_DBCMPTLEVEL 存儲過程一共需要兩個參加,第一個參數為數據庫名,在上面的例子中我的數據庫名為“PMS”,第二個參數為想要設置的sql server版本號,其對應關系如下 80 = SQL Server 2000 90 = SQL Server 2005 100 = SQL Server 2008 ,在上面的例子中由于我想和sql server 2005兼容,所以設置版本號為90。
publicpartialclassTest
{
publicvoid one()
{
}
publicpartialclassTest
{
publicvoid Two()
{
}
結構是 存儲在棧上 的 值類型)和 它們的一些特征(如 結構不支持繼承。 較小的 數據類型使 用結
構可提高性能。 但在語法上,結 構與類非常相似,主 要的區別是使用關鍵字 struct代 替 dass來 聲明結構。
static void someFunction(out int i)
(
i= 100;
I
public static int Main()
(
int i // note how i ig dec△ ared but not initia△ ized.
someFunCtion(out i)`
C0nsole.WriteLine(i)`
Return
}
virtual 關鍵字用于在基類中修飾方法。virtual的使用會有兩
種情況:
情況1:在基類中定義了virtual方法,但在派生類中沒有重寫
該虛方法。那么在對派生類實例的調用中,該虛方法使用的是基
類定義的方法。
情況2:在基類中定義了virtual方法,然后在派生類中使用
使用的是派生重寫的方法。
二、Abstract方法(抽象方法)
abstract關鍵字只能用在抽象類中修飾方法,并且沒有具體的
實現。抽象方法的實現必須在派生類中使用override關鍵字來實
現
var Layer='';
var iLayerMaxNum=1000;
var a;
document.onmouseup=me;
document.onmousemove = ms;
var b;
var c;
function Move(Object,event){
Layer=Object.id;
if(document.all){
document.getElementById(Layer).setCapture();
b=event.x-document.getElementById(Layer).style.pixelLeft;
c=event.y-document.getElementById(Layer).style.pixelTop;
}elseif(window.captureEvents){
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
b=event.layerX;
c = event.layerY + 100;
};
if(Layer!="Layer"+a){
document.getElementById(Layer).style.zIndex=iLayerMaxNum;
iLayerMaxNum=iLayerMaxNum+1;
}
}
function ms(d){
if(Layer!=''){
if(document.all){
document.getElementById(Layer).style.left=event.x-b;
document.getElementById(Layer).style.top=event.y-c;
}elseif(window.captureEvents){
document.getElementById(Layer).style.left=(d.clientX-b)+"px";
document.getElementById(Layer).style.top=(d.clientY-c)+"px";
}
}
}
function me(d){
if(Layer!=''){
if(document.all){
document.getElementById(Layer).releaseCapture();
Layer='';
}elseif(window.captureEvents){
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
Layer='';
}
}
}
function Close(n){
var e='Layer'+n;
document.getElementById(e).style.display='none';
Hide();
}
//顯?示º?高?亮¢¨¢的Ì?字Á?條¬?
function Show(n){
var e=document.getElementById('Layer'+n);
if (e){
e.style.zIndex =iLayerMaxNum+1;
document.getElementById("mask").style.display = "block";
document.getElementById("mask").style.zIndex = iLayerMaxNum;
var size = getPageSize();
document.getElementById("mask").style.width = size[0];
document.getElementById("mask").style.height = size[1];
}else{
alert("對?不?起e,ê?您¨²搜?索¡Â的Ì?字Á?條¬?不?存ä?在¨²!ê?");
history.back(1);
}
}
function Hide(){
document.getElementById("mask").style.display = "none";
iLayerMaxNum=iLayerMaxNum+2;
}
function getPageSize(){
var de = document.documentElement;
var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
var h = window.innerHeight || self.innerHeight || document.body.clientHeight || (de&&de.clientHeight);
arrayPageSize = new Array(w,h);
return
新聞熱點
疑難解答