分页: 4/31 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 下页 最后页 [ 显示模式: 摘要 | 列表 ]

C#的时间正则表达式

[不指定 2008/06/26 11:40 | by Else ]
[codes=C#]
///
public string timeformat(string timestr)
        {

            timestr = timestr.Trim();


            if (Regex.IsMatch(timestr, @"^(\d{4})\D*(\d{2})\D*(\d{2})$"))
            {
            
          
                //this.Nodate = true;
                return Regex.Replace(timestr, @"^(\d{4})\D*(\d{2})\D*(\d{2})$", "$1-$2-$3", RegexOptions.None);
                
            }
            
            else
            {
               // this.Nodate = false;
                return timestr;
              

            }

        }[/codes]
Tags: ,

php-et 分页的类写好了

[不指定 2008/06/23 22:21 | by Else ]
哈哈,慢慢的完成,要是当时写成这样子的话,我写在做网站的速度应该会快很多,今天玩成了很多,注册了园子,然后问的问题,解决,接着完成这个类,然后在改代码!

现在是升级,网站这样写的快多了!
代码还在不断的完成中!原来的cuku.net的程序,现在在改成这样的! 目前cuku.php这个类的话叫1.0好了!

好了,先这样了,目前还没有什么代码要封装了!

            object oMissing = Missing.Value;

            Microsoft.Office.Interop.Excel.Application ExcelObj =
                new Microsoft.Office.Interop.Excel.Application();

            Microsoft.Office.Interop.Excel.Workbook WBook;

            Microsoft.Office.Interop.Excel.Worksheet WSheet;

            Microsoft.Office.Interop.Excel.Range Selection;

            WBook = ExcelObj.Workbooks.Open(@"c:\test\1.xlsx",

                oMissing, oMissing, oMissing, oMissing, oMissing,

                oMissing, oMissing, oMissing, oMissing, oMissing,

                oMissing, oMissing, oMissing, oMissing);
Tags: , ,

選擇文件 c#

[不指定 2008/06/12 15:20 | by Else ]
[codes=C#]  private void btn_select_Click(object sender, EventArgs e)
        {
          
                OpenFileDialog fdlg = new OpenFileDialog();              
              
                fdlg.Filter = "All files (*.xls)|*.xls|All files (*.xls)|*.xls";
                fdlg.FilterIndex = 2;
                
                if (fdlg.ShowDialog() == DialogResult.OK)
                {
                    txt_file_path.Text = fdlg.FileName;
                }

        }[/codes]

关于投票的限制设置

[不指定 2008/06/11 11:24 | by Else ]
这个是目前用cookie做的,之前听说php4对cookie的支持不好之类的话,没有试过,但是现在认为,没有必要为php4而限制代码
现在这个是用一个cookie来保存这些投票
[codes=php]if (!isset($_COOKIE['time_report']))
    {
      $_COOKIE['time_report']=array();
    }
    
    foreach ($_COOKIE["time_report"] as $upid)
    {
      if ($upid==$_POST['up'])
      {
        die("你已投过票了");
      }
      
    }
    setcookie("time_report[".$_POST['up']."]",$_POST['up'],time()+3600);
    
    $db->query(sprintf("UPDATE ck_comment set zc=zc+1 where id=%d",$_POST['up']));
    $sql=sprintf("select zc from ck_comment where id=%d",$_POST['up']);
    $rs=$db->rows($sql);
    echo $rs['zc'];[/codes]

php cookie

[不指定 2008/06/10 11:07 | by Else ]
昨天晚上到现在的一个测试
代码通过测试
[codes=php]// 设定 cookie
for ($i = 0; $i < 10; $i++) {
   $time[$i] = time();
   setcookie("time_report[$i]",$time[$i], $time[$i]+3600*$i);
}

print_r($_COOKIE["time_report"]);

?>





echo $_COOKIE["time_report"][2];
?>




echo $_COOKIE["time_report[2]"];//这个是错误的
?> [/codes]
Tags: ,

VC小技巧20个  

[不指定 2008/06/06 13:59 | by Else ]
一、打开CD-ROM
mciSendString("Set cdAudio door open wait",NULL,0,NULL);

二、关闭CD_ROM
mciSendString("Set cdAudio door closed wait",NULL,0,NULL);

三、关闭计算机
OSVERSIONINFO OsVersionInfo; //包含操作系统版本信息的数据结构
OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&OsVersionInfo); //获取操作系统版本信息
if(OsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
    //Windows98,调用ExitWindowsEx()函数重新启动计算机
    DWORD dwReserved;
    ExitWindowsEx(EWX_REBOOT,dwReserved); //可以改变第一个参数,实现注销用户、
    //关机、关闭电源等操作

    // 退出前的一些处理程序
}

Tags:

算法大全(C,C++)

[不指定 2008/05/30 14:17 | by Else ]
一、  数论算法

1.求两数的最大公约数

function gcd(a,b:integer):integer;
begin
if b=0 then gcd:=a
else gcd:=gcd (b,a mod b);
end ;


2.求两数的最小公倍数

function lcm(a,b:integer):integer;
begin
if a<b then swap(a,b);
lcm:=a;
while lcm mod b>0 do inc(lcm,a);
end;


3.素数的求法
A.小范围内判断一个数是否为质数:

function prime (n: integer): Boolean;
var I: integer;
begin
for I:=2 to trunc(sqrt(n)) do
if n mod I=0 then begin
prime:=false; exit;
end;
prime:=true;
end;

這個是最新的下載地址

到時候換個php的

文件下载地址


http://www.uushare.com/user/cukunet/file/877278
Tags:

OleDbType 枚举

[不指定 2008/05/26 14:32 | by Else ]
[quote]成员名称
说明


  
BigInt
64 位带符号的整数 (DBTYPE_I8)。它映射到 Int64。


  
Tags:
分页: 4/31 第一页 上页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 下页 最后页 [ 显示模式: 摘要 | 列表 ]