分类目录
文章索引模板
C#中获取CPU序列号、网卡Mac地址、IP地址、硬盘序列号、登录用户名、PC类型、计算机名称、物理内存 - 十月 26, 2009 by yippee

C#中获取CPU序列号、网卡Mac地址、IP地址、硬盘序列号、登录用户名、PC类型、计算机名称、物理内存


using System;
using System.Management;
namespace Soyee.Comm
{
 /// <summary>
 /// Computer Information
 /// </summary>
 public class Computer
 {
  public string CpuID;
  public string MacAddress;
  public string DiskID;
  public string IpAddress;
  public string LoginUserName;
  public string ComputerName;
  public string SystemType;
  public string TotalPhysicalMemory; //单位:M
     private static Computer _instance;
  public static Computer Instance()
  {
   if (_instance == null)
    _instance = new Computer();
   return _instance;
  }
  protected  Computer()
  {
   CpuID=GetCpuID();
   MacAddress=GetMacAddress();
   DiskID=GetDiskID();
   IpAddress=GetIPAddress();
   LoginUserName=GetUserName();
   SystemType=GetSystemType();
   TotalPhysicalMemory=GetTotalPhysicalMemory();
   ComputerName=GetComputerName();
  }
  string  GetCpuID()
  {
   try
   {
    //获取CPU序列号代码
    string cpuInfo = “”;//cpu序列号
    ManagementClass mc = new ManagementClass(“Win32_Processor”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
     cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
    }
    moc=null;
    mc=null;
    return cpuInfo;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  
  }
  string  GetMacAddress()
  {
   try
   {
    //获取网卡Mac地址
    string mac=”";
    ManagementClass mc = new ManagementClass(“Win32_NetworkAdapterConfiguration”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
     if((bool)mo["IPEnabled"] == true)
     {
      mac=mo["MacAddress"].ToString();
      break;
     }
    }
    moc=null;
    mc=null;
    return mac;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  
  }
  string  GetIPAddress()
  {
   try
   {
    //获取IP地址
    string st=”";
    ManagementClass mc = new ManagementClass(“Win32_NetworkAdapterConfiguration”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
     if((bool)mo["IPEnabled"] == true)
     {
      //st=mo["IpAddress"].ToString();
      System.Array ar;
      ar=(System.Array)(mo.Properties["IpAddress"].Value);
      st=ar.GetValue(0).ToString();
      break;
     }
    }
    moc=null;
    mc=null;
    return st;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  
  }
 
  string  GetDiskID()
  {
   try
   {
    //获取硬盘ID
    String HDid=”";
    ManagementClass mc = new ManagementClass(“Win32_DiskDrive”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
     HDid = (string)mo.Properties["Model"].Value;
    }
    moc=null;
    mc=null;
    return HDid;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
   
  }


  /// <summary>
  /// 操作系统的登录用户名
  /// </summary>
  /// <returns></returns>
  string  GetUserName()
  {
   try
   {
    string st=”";
    ManagementClass mc = new ManagementClass(“Win32_ComputerSystem”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
    
     st=mo["UserName"].ToString();
    
    }
    moc=null;
    mc=null;
    return st;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  
  }



  /// <summary>
  /// PC类型
  /// </summary>
  /// <returns></returns>
  string  GetSystemType()
  {
   try
   {
    string st=”";
    ManagementClass mc = new ManagementClass(“Win32_ComputerSystem”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
    
     st=mo["SystemType"].ToString();
    
    }
    moc=null;
    mc=null;
    return st;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  
  }


  /// <summary>
  /// 物理内存
  /// </summary>
  /// <returns></returns>
  string  GetTotalPhysicalMemory()
  {
   try
   {
   
    string st=”";
    ManagementClass mc = new ManagementClass(“Win32_ComputerSystem”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
    
     st=mo["TotalPhysicalMemory"].ToString();
    
    }
    moc=null;
    mc=null;
    return st;
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  }
  /// <summary>
  /// 计算机名称
  /// </summary>
  /// <returns></returns>
  string  GetComputerName()
  {
   try
   {   
    return System.Environment.GetEnvironmentVariable(“ComputerName”);
   }
   catch
   {
    return “unknow”;
   }
   finally
   {
   }
  }



 }
}

标签:, ,
获取安装目录、临时目录等系统信息的C#源代码 - 十月 25, 2009 by yippee

获取安装目录、临时目录等系统信息的C#源代码


using System;
using System.Management;
using System.Threading;
namespace Soyee.Comm
{
 /// Operate MetaSystem information
 /// </summary>
 public class Software
 {
  public string OSType;
  public string OSVersion;
  public string WinTempDir;
  public string WinDir;
  public string SystemDirectory;
  /// <summary>
  /// Aplication file directory ,postfix is “\” .for example, D:\Test\Bin\
  /// </summary>
  public string AplicationDir;
  public string AplicationName;
  /// <summary>
  /// Aplication  root directory,postfix is “\” . for example, D:\Test\
  /// </summary>
  public string InstallDirectory;
  public string UserDomainName;
  public long WorkingMemory;
  private static Software _instance;
  public static Software Instance()
  {
   if (_instance == null)
    _instance = new Software();
   return _instance;
  }
  public Software()
  {
   OSType= System.Environment.GetEnvironmentVariable(“OS”);
   WinTempDir=System.Environment.GetEnvironmentVariable(“TEMP”);
   WinDir=System.Environment.GetEnvironmentVariable(“WINDIR”);
   AplicationDir=System.Environment.CurrentDirectory+@”\“;
   OSVersion=System.Environment.OSVersion.ToString();
   SystemDirectory=System.Environment.SystemDirectory;
   UserDomainName=System.Environment.UserDomainName;
   WorkingMemory=System.Environment.WorkingSet;
   InstallDirectory=AplicationDir.Replace(@”\bin\Debug”,”").Replace(@”\bin\Release”,”");
   AplicationName=GetAplicationName();
  }


  public string GetInstallDir()
  {
      string dir;
   dir=AplicationDir;
   for (int i = 0; i<3;i++)
   {
    dir=dir.Substring(0,dir.LastIndexOf(@”\”));
   }
   return dir+@”\“;
  }
  string  GetAplicationName()
  {
   try
   {
    //获取应用程序名称
    string st=”";
    ManagementClass mc = new ManagementClass(“Win32_Process”);
    ManagementObjectCollection moc = mc.GetInstances();
    foreach(ManagementObject mo in moc)
    {
     st=mo["Caption"].ToString();
    }
    //moc.Dispose();
    //mc.Dispose();
    moc=null;
    mc=null;
    return st;
   }
   finally
   {
   }
  
  }
 }
}

标签:, ,
Wpf模拟时钟代码实现analogicclock - 九月 5, 2009 by yippee

WPF画个时钟真是方便,可是我碰到得问题是,我得用代码实现。这下可真是够麻烦。
得把XAML的代码一行行用C#写。
然后把DATABIND改为定时器··
还没搞清楚DATABIND机制···
搞了半天终于OK了。

制作简单的WPF时钟 – 大可山博客[GDI+,WPF, .Net图形图像] – CSDN博客
http://blog.csdn.net/johnsuna/archive/2007/10/26/1845605.aspx



3D Digital Clock for WPF – Home
http://solnick.codeplex.com/



CodeProject: Creating a look-less custom control in WPF. Free source code and programming help
http://www.codeproject.com/KB/WPF/WPFCustomControl.aspx



CodeProject: A WPF Digital Clock. Free source code and programming help
http://www.codeproject.com/KB/WPF/digitalclock.aspx



WPF: A ControlTemplate for an Analog Clock | Sahil Malik – blah.winsmarts.com
http://blah.winsmarts.com/2007-3-WPF__A_ControlTemplate_for_an_Analog_Clock.aspx



The Joy Of Programming: Simple WPF Clock using Microsoft Expression Blend
http://proxycrowd.com/browse.php?b=5&u=Oi8vam9iaWpveS5ibG9nc3BvdC5jb20vMjAwNy8wMy9zaW1wbGUtd3BmLWNsb2NrLXVzaW5nLW1pY3Jvc29mdC5odG1s



Implementing an analogic clock in WPF – Orlando Perri
http://blogs.windowsclient.net/orlando_perri/archive/2009/07/29/implementing-an-analogic-clock-in-wpf.aspx



Aaltra blog – Create analog clock in WPF
http://blog.aaltra.eu/en/tech/createanalogclockinwpf



3D Digital Clock for WPF – Home
http://solnick.codeplex.com/



CodeProject: Analog Clock in WPF. Free source code and programming help
http://www.codeproject.com/KB/WPF/WpfClock.aspx



Analog Clock Widget
http://www.c-sharpcorner.com/UploadFile/dpatra/105202009092936AM/1.aspx



Tutorial: Create a Win32 Application Hosting WPF Content
http://msdn.microsoft.com/en-us/library/aa970266.aspx



Analog Clock – C# version
http://geekswithblogs.net/rebelgeekz/archive/2004/02/12/2078.aspx



WPF 2D Transformations — CodeGuru.com
http://www.codeguru.com/csharp/csharp/cs_misc/userinterface/article.php/c12221


 


http://www.galasoft.ch/mydotnet/articles/resources/article-2006102701/Page1.xaml.cs.txt



WPF自定义控件 —— 复合控件(中国象棋联机版) – 咖喱块 – 博客园
http://www.cnblogs.com/Curry/archive/2009/05/06/1450383.html



WPF自定义控件 —— 复合控件(中国象棋联机版) – 咖喱块 – 博客园
http://www.cnblogs.com/Curry/archive/2009/05/06/1450383.html



21.2.2 使用代码创建动画(1) – 51CTO.COM
http://book.51cto.com/art/200908/145521.htm



WPF 深入研究 之 Control 控件 – 包建强的开源地带 – 博客园
http://www.cnblogs.com/Jax/archive/2009/02/11/1194218.html



WPF學習日誌 ~2008年3月號~ – 精華區 – VB2005討論板 – VB研究小站討論區 – Powered by Discuz!
http://www.ncis.com.tw/ncis_bbs/viewthread.php?tid=1457



SerialSeb: WPF Tips’n'Tricks #8: Use your code-behind for binding
http://ih8filters.com/browse.php?b=5&u=Oi8vc2VyaWFsc2ViLmJsb2dzcG90LmNvbS8yMDA3LzEwL3dwZi10aXBzLTgtdXNlLXlvdXItY29kZS1iZWhpbmQtZm9yLmh0bWw%3D



July 2009 – Posts – Orlando Perri
http://blogs.windowsclient.net/orlando_perri/archive/2009/07.aspx



WiredPrairie: Coding Archives
http://www.wiredprairie.us/journal/coding/



Spinning Progress Control in WPF
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0875ebf8-bb77-45ea-a929-d40743a3bf03/



WPF: Synchronizing animations (part 1: Using built-in features)
http://www.galasoft.ch/mydotnet/articles/article-2007060701.aspx



 

标签:, , ,
0919 vc 对话框 重构 代码 STATE 友元 - 二月 28, 2007 by yippee

0919 vc 对话框 重构 代码 STATE 友元

由于对话框各种点击状态切换非常麻烦,想看看能不能整理

状态机的两种写法
有限状态机FSM思想广泛应用于硬件控制电路设计,也是软件上常用的一种处理方法(软件上称为FMM–有限消息机)。它把复杂的控制逻辑分解成有限个稳定状态,在每个状态上判断事件,变连续处理为离散数字处理,符合计算机的工作特点。同时,因为有限状态机具有有限个状态,所以可以在实际的工程上实现。但这并不意味着其只能进行有限次的处理,相反,有限状态机是闭环系统,有限无穷,可以用有限的状态,处理无穷的事务。
    有限状态机的工作原理如图1所示,发生事件(event)后,根据当前状态(cur_state),决定执行的动作(action),并设置下一个状态号(nxt_state)。
==================================
竖着写(在状态中判断事件)C代码片段
==================================
    cur_state = nxt_state;
    switch(cur_state)&leftsign;                  //在当前状态中判断事件
        case s0:                        //在s0状态
            if(e0_event)&leftsign;               //如果发生e0事件,那么就执行a0动作,并保持状态不变;
                执行a0动作;
                //nxt_state = s0;       //因为状态号是自身,所以可以删除此句,以提高运行速度。
            &rightsign;
            else if(e1_event)&leftsign;          //如果发生e1事件,那么就执行a1动作,并将状态转移到s1态;
                执行a1动作;
                nxt_state = s1;
            &rightsign;

==================================
横着写(在事件中判断状态)C代码片段
==================================
//e0事件发生时,执行的函数
void e0_event_function(int * nxt_state)
&leftsign;
    int cur_state;
   
    cur_state = *nxt_state;
    switch(cur_state)&leftsign;
        case s0:                        //观察表1,在e0事件发生时,s1处为空
        case s2:
            执行a0动作;
            *nxt_state = s0;
    &rightsign;
&rightsign;

//e1事件发生时,执行的函数
void e1_event_function(int * nxt_state)
&leftsign;
    int cur_state;
   
    cur_state = *nxt_state;

上面横竖两种写法的代码片段,实现的功能完全相同,但是,横着写的效果明显好于竖着写的效果。理由如下:
    1、竖着写隐含了优先级排序(其实各个事件是同优先级的),排在前面的事件判断将毫无疑问地优先于排在后面的事件判断。这种if/else if写法上的限制将破坏事件间原有的关系。而横着写不存在此问题。
    2、由于处在每个状态时的事件数目不一致,而且事件发生的时间是随机的,无法预先确定,导致竖着写沦落为顺序查询方式,结构上的缺陷使得大量时间被浪费。对于横着写,在某个时间点,状态是唯一确定的,在事件里查找状态只要使用switch语句,就能一步定位到相应的状态,延迟时间可以预先准确估算。而且在事件发生时,调用事件函数,在函数里查找唯一确定的状态,并根据其执行动作和状态转移的思路清晰简洁,效率高,富有美感。
    总之,我个人认为,在软件里写状态机,使用横着写的方法比较妥帖。

class DlgMain;
class DlgSub;
class DlgSubS;
class DlgMain
&leftsign;
public:
 void outputt() &leftsign;printf("this   is   %d\\n",b);  &rightsign; //对话框函数
 int b; //对话框变量

 friend class DlgSub; //友元类
 DlgSubS *dlgsubs; //友元集合
 void Init(); //初始化
 void Deal(int i);
&rightsign;;
class DlgSub
 &leftsign;
public:
 class DlgMain *dlgmain;
 public:
  virtual void Deal()&leftsign;&rightsign;;//处理界面
 &rightsign;;
class DlgSub1: public DlgSub //状态1
&leftsign;
public:
 void Deal() &leftsign;dlgmain->b=1;dlgmain->outputt();&rightsign;;
&rightsign;;
class DlgSub2: public DlgSub
&leftsign;
public:
 void Deal() &leftsign;dlgmain->b=2;dlgmain->outputt();&rightsign;;
&rightsign;;

class DlgSubS
&leftsign;
public:
 class DlgSub1 c1;
 class DlgSub2 c2;
 void Init(DlgMain *b)
 &leftsign;
  c1.dlgmain=b;
  c2.dlgmain=b;
 &rightsign;
 void Deal(int i)
 &leftsign;
  if (i==1)
   c1.Deal();
  else
   c2.Deal();
 &rightsign;
 
&rightsign;; [hide]
void DlgMain::Init()
&leftsign;
 dlgsubs =new DlgSubS();
 dlgsubs->Init(this);
&rightsign;; [/hide]
void DlgMain::Deal(int i)
&leftsign;
 dlgsubs->Deal(i);
&rightsign;;

void main()
&leftsign;
 DlgMain mainn;
 mainn.Init();
 mainn.Deal(2);
 // subA   ao,

 State模式最大的特点是可以自行变更自身的状态,从而改变因不同状态带来的不同行为。状态的改变都是在内部完成的。但我感觉这个状态比较合适同步的方式,对异步来说有点太困难了。

个项目的开发过程中,需要实现一个有限状态机,于是马上想到用state模式实现,效果还算不错,但有几个问题想和各位探讨一下。 
首先,使用state模式是为了消除复杂的if-else语句或者switch-case语句,但是由于各个模式间转换也会有非常多条件,状态类中if-else语句或者switch-case语句仍然避免不了。 
其次,本来设计的所有的状态类都是singlton模式,不在state中存储局部状态。一、是为了方便编程,不用动态创建,也就不用考虑销毁的问题,因此消除了内存泄漏的隐患;二,有限状态机是和每个客户绑定的,不同的客户对应不同的有限状态机,我们不想让系统在状态子类上的开销太大。但这样,也带来的一个问题,由于有限状态机的状态太多,而且到现在仍未确定,也就是说,有增加新的状态子类的可能,而且会很多。为了解决这个问题,我在后期加的状态类中不再使用singlton模式,而是用普通的对象创建方式,以便在里面存储状态,也就是说用一个状态类来替代可能增加的一系列的状态转换。但这使得系统设计不纯,可能会给以后的维护带来文题。 

标签:, , , , ,
0917 vc 对话框 程序 代码 重构 组合键 - 二月 26, 2007 by yippee

0917 vc 对话框 程序 代码 重构

一个 vc 对话框 程序 ,界面控制比较多,代码写的也比较多,看上去很头大
很想把它分割开,不过如果采取传THIS指针给新类,觉得很麻烦,新类里面都要->调用。

看看资料:
能不能使用基类的指针调用子类的方法?
class   A  
  &leftsign;  
  public:  
  virtual   void   output()  
  &leftsign;  
  printf("this   is   A\\n");  
  &rightsign;  
  &rightsign;  
  class   subA   :   public   A  
  &leftsign;  
  void   output()  
  &leftsign;  
  printf("this   is   subA\\n");  
  &rightsign;  
  &rightsign;  
  A   *pao   =   new   subA;  
  pao->output();   //   这就是使用得subA得output  
如果楼主的subA   是public方法的话,   其实可以:  
  ((subA*)pao)   ->   output();  

C++中的纯虚函数
纯虚函数是在基类中声明的虚函数,它在基类中没有定义,但要求任何派生类都要定义自己的实现方法。在基类中实现纯虚函数的方法是在函数原型后加“=0”
virtual void funtion1()=0

基类:
class A 
&leftsign;
public:
 A();
 void f1();
 virtual void f2();
 virtual void f3()=0;
 virtual ~A();

&rightsign;;

子类:
class B : public A 
&leftsign;
public:
 B();
 void f1();
 void f2();
 void f3();
 virtual ~B();

&rightsign;;
主函数:
int main(int argc, char* argv[])
&leftsign;
 A *m_j=new B();
 m_j->f1();
 m_j->f2();
 m_j->f3();
 delete m_j;
 return 0;
&rightsign;

测试:
class   subA;
class   Aa 
&leftsign;  
public:  
 virtual void   output1() =0;
 virtual void   output2() =0;
 int aa(); 
&rightsign;;
class   subA:   public   Aa  
&leftsign;  
 public: 
 void   output1()  
 &leftsign;  
  output2();  
 &rightsign;  
 void   output2()  
 &leftsign;  
  printf("this   is   subA2\\n");  
 &rightsign;  
&rightsign;;
int Aa::aa()
 &leftsign;
  output1();
  return 1;
 &rightsign;

void main()
&leftsign;
 subA   ao,   *pao=&ao;  
 pao->aa();
&rightsign;

void CMFCControlWinCtrl::OnKeyDown(UINT nChar,UINT nRepCnt,UINT nFlags)

&leftsign;

BOOL bHandled=FALSE;

shortsShift=::GetKeyState(VK_SHIFT);

shortsControl=::GetKeyState(VK_CONTROL);

switch(nChar)

&leftsign;

case 0×56://`V~//PASTE

case 0×76://`v~

if(sControl&0×8000)

&leftsign;
 
this->GetDataFromClipboard();

this->InvalidateControl(NULL);

bHandled=TRUE;

&rightsign;

标签:, , , ,
0129 SIP WENGO 代码 - 三月 24, 2006 by yippee

0129 SIP WENGO 代码

看到上面:

We are looking for enthusiastic developers! Rewards will, of course, include free calls, free software and unlimited glory. Want to be part of the adventure?
  This area of the OpenWengo website is dedicated to developers and advanced users who might want to help the project by reporting and/or fixing bugs, adding new features, making the Wengophone smaller, faster and more portable, or making its development and use easier for others by writing documentation.
We use the SVN revision control system, so you\’ll need to configure your system accordingly. Clients for MS Windows and the Eclipse Platform are available, among many other. 

To do a checkout of the source, issue the following command:
svn co http://guest:guest@dev.openwengo.com/svn/openwengo   The community has access to Trac, a web-based software project management tool which provides us with a Wiki, bug/issue tracking, a roadmap and more… 
   Additionaly, one can subscribe to our public mailing list to receive updates and communicate with fellow Wengophone developers. 
You may also want to contribute to our forum!
Happy patching ;-)
 Need help ?
? Check the FAQ
? Browse the Forum 
 Wengo enables you to call anyone, anywhere, for free.
? learn more  

homePage what is it ? get it ! my Wengo developers
forum legal notices neuf telecom wengo.fr  

 于是用SVN想弄下来,不曾想居然整整弄了两个小时,最后实在撑不住,居然看起了人鱼小姐,终于到了凌晨两点弄下来了。

 看了看属性:
790 MB (828,938,346 字节)
占用 1.26 GB (1,360,388,096 字节)
119 910个文件,20998个文件夹。

MY GOD!!!

好像还在不停升级中,0128就提交了如下:
enabled g729 payload
Arts shouldn\’t be compiled by default.
Initial support of INTEL IPP based codecs
fix to search payload by mime code
WengoPhoneNg: does not block while loading contactlist. Still needs work
work on imchat (phapiwrapper)
WengoPhoneNg #319 : work on Presence/Chat support. Added a log message

Repository Architecture:
- trunk/                   SoftPhone NG: Next Generation\’s development branch.
- softphone-classic/       SoftPhone Classic: Classic\’s stable and development branch.
  – softphone-classic/branches/1.0 Classic\’s 1.0 development branch, should build on most platform at any time.
  – softphone-classic/trunk  Classic\’s development branch, broken most of the time, not guaranteed to build.
- doc                      Various documentation.
- script     Utility scripts used by developers.
- old                      Old content that should not be of any interest to anyone.
- playground               Sandbox used by developers to experiment new things. 

编译方法:
Common requirements ?
In order to build the WengoPhone NG, you\’ll need several components :

A C and C++ compiler. GCC and G++ are perfectly supported on UNIX platforms, MinGW andVisual C++ are supported on Windows platforms.
WengoPhone NG source code. You can get information about how to get it here.
Scons which itself depends on Python.
Qt 4.1 with STL, exceptions and RTTI support enabled (use of earlier versions will result in build errors) Open Source version. You can download it here. Qt 4.1 is available is only available as source code for most OS and GNU/Linux distributions, so it is very likely that you will have to build it yourself.
Usually, is are available as packages on most OSes and most major GNU/Linux distributions. Please, use these packages when available instead of installing the requirements from source, it will save you from most of the effort. On the Win32 platform, Qt 4.x open source edition supports only gcc through MinGW packages. This patch, contributed by the Qt/Win project, adds support for MSVC.NET.

Boost, version 1.33 or later with support for unit testing framework, threading and serialization. On Win32 platforms, you\’ll need to install it from sources. Please, refer to this documentation in order to do it. On UNIX platforms, you should refer to your specific vendor\’s documentation. Usually, installing boost on your UNIX system is done in one of the two following way:
Installing it from source, as on Win32 platforms.
Installing it from binary package provided by your vendor. Please, keep in mind that boost binary packages are split by components (threading, serialization, etc.), so you\’ll probably need to install several binary packages.
glib development packages. They are packaged on most UNIX-like systems. Version 2.0 or later is necessary.
Speex. If you use any other OS than Windows, you should install the Speex development package provided by your operating system vendor.
They are also some platform specific requirements listed below.

Build process on Windows with Visual Studio ?
Before building the WengoPhone NG on Windows, you need to setup some environment variables :

QTDIR must be set to the path where Qt has been installed.
LIB must be changed to add the following content to it :
C:\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\Lib
C:\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\Lib
C:\\Microsoft Visual Studio .NET 2003\\Vc7\\lib
C:\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\lib
INCLUDE must be changed to add the following content to it :
C:\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\include
C:\\Microsoft Visual Studio .NET 2003\\Vc7\\include
C:\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\Include
C:\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include
There are two ways to achieve this : on the command line and with a graphical frontend via the "System" section of the Control Panel.

Then, in order to get around a build process\’ bug, you should copy \\libs\\ffmpeg\\binary-lib\\avcodec.lib to the root of your working copy. You can now enter the following command in C:\\dev\\wengophone-ng (or whereever you chose to checkout NG source code) :

scons qtwengophone wengocurl phapi avcodec
At the end of the build process, Scons should write the message "Scons: done building targets" to the console.

标签:, ,
0120 gmail 增长 数字 代码 - 三月 15, 2006 by yippee

01200 gmail 增长 数字 代码

Google 提供的电子邮件服务。   
Gmail 是一种新型的 Webmail,能够给用户带来全新的体验。它基于这样一个理念,即您无需删除邮件,而且始终可以找到您需要的邮件。主要特点包括:
搜索但不排序。
无论何时发送出、何时接收到,都可以使用 Google 搜索准确地找到所需的邮件。
无需删除任何邮件。
超过 2686.198498 MB(还在增加中)的免费存储空间供您随意使用,您永远不必再删除任何邮件。
所有邮件均有上下文。
每封邮件与其所有的回复邮件组合在一起,作为一个会话显示。
无弹出式广告。也不投放无针对性的横幅广告。
您只会看到相关的文字广告和指向您感兴趣的相关网页的链接。
 
其中:超过 2686.198498 MB(还在增加中) 这个数字是不断变化的

看看源码:
超过 <span id="quota">2000</span> MB(还在增加中)的免费存储空间供您随意使用,您永远不必再删除任何邮件。
在IE中,层依靠<DIV></DIV>和<SPAN></SPAN>来实现,两者基本相同,通常<DIV>用于较大的层,<SPAN>用于较小的层,并且<DIV>在实现的层后面加上一个回车换行,而<SPAN>不加。它的语法如下(二者相同):   <div id=layername style="style definition">Layer content</div> 或   <div id=layername class="classname">Layer content</div>  

var CP = [
 [ 1128150000000, 2650 ],
 [ 1136102400000, 2680 ],
 [ 1149145200000, 2730 ]
];

var quota;

function updateQuota() &leftsign;
  if (!quota) &leftsign;
    return;
  &rightsign;

  var now = (new Date()).getTime();
  getTime() : 返回毫秒数 提供一个有关日期和时间的对象。

  var i;
  for (i = 0; i < CP.length; i++) &leftsign;
    if (now < CP[i][0]) &leftsign;
      break;
    &rightsign;
  &rightsign;
  if (i == 0) &leftsign;
    setTimeout(updateQuota, 1000);
 setTimeout(…)这项新函式是用来作为一个 "定时器"。setTimeout(…)能作些什麽事呢?它的主要特性是当某段设定的时间 "跑" 完了之後,便执行某函式。
  &rightsign; else if (i == CP.length) &leftsign;
    quota.innerHTML = CP[i - 1][1];
  &rightsign; else &leftsign;
    var ts = CP[i - 1][0];
    var bs = CP[i - 1][1];
    quota.innerHTML = format(((now-ts) / (CP[i][0]-ts) * (CP[i][1]-bs)) + bs);
    setTimeout(updateQuota, 1000);
  &rightsign;
&rightsign;

var PAD = \’.000000\’;

function format(num) &leftsign;
  var str = String(num);
  var dot = str.indexOf(\’.\’);
  if (dot < 0) &leftsign;
     return str + PAD;
  &rightsign; if (PAD.length > (str.length – dot)) &leftsign;
    return str + PAD.substring(str.length – dot);
  &rightsign; else &leftsign;
    return str.substring(0, dot + PAD.length);
  &rightsign;
&rightsign;

标签:,
0104 wince .net romdump 代码 - 二月 5, 2006 by yippee

0104 wince .net romdump 代码

根据人家的代码,编译了一下 ROMDUMP,将ROM备份下来

 HANDLE H=CreateFile(L"\\\\Storage Card\\\\123.bin",GENERIC_WRITE,0,0,CREATE_ALWAYS,FILE_FLAG_WRITE_THROUGH,0);
 if(H==INVALID_HANDLE_VALUE)
 &leftsign;
  MessageBox(L"Cannot create file!",L"Error",MB_OK);
  PostQuitMessage(0);
  return;
 &rightsign;
 for(int i=0; i<64*1024*1024; i+=512*1024)
 &leftsign;
  LPVOID Ptr=VirtualAlloc(
   0,
   512*1024,
   MEM_RESERVE,
   PAGE_READONLY
   );
  if(Ptr==0)
  &leftsign;
   wchar_t Buff[1024];
   wsprintf(Buff,L"Cannot allocate %08X",i);
   MessageBox(Buff,L"Error",MB_OK);
   PostQuitMessage(0);
   return;
  &rightsign;
  //m_Progress.SetPos(i/(64*1024*1024/100));
  UpdateWindow();
  if(!VirtualCopy(Ptr,(void*)(i/256),512*1024,PAGE_READONLY&line;PAGE_PHYSICAL))
  &leftsign;
   wchar_t Buff[1024];
   wsprintf(Buff,L"Cannot map %08X",i);
   MessageBox(Buff,L"Error",MB_OK);
   PostQuitMessage(0);
   return;
  &rightsign;
  DWORD W=0;
  WriteFile(H,Ptr,512*1024,&W,0);
  if(W!=512*1024)
  &leftsign;
   MessageBox(L"Error on WriteFile. Card full?",L"Error");
   PostQuitMessage(0);
   return;
  &rightsign;
  VirtualFree(Ptr,0,MEM_RELEASE);
 &rightsign;
 CloseHandle(H);

 MessageBox(L"Successfully dumped ROM!",L"Done");
 PostQuitMessage(0);

VirtualCopySee Also
CEL_VIRTUAL_COPY &line; CeLogData &line; HiveRAMRegion &line; MmMapIoSpace &line; NdisFlushBuffer &line; Trusted APIs &line; VirtualAlloc

Requirements
OS Versions: Windows CE 2.10 and later.
Header: Pkfuncs.h.
Link Library: Coredll.lib.
This function binds a specific physical memory range to a statically mapped virtual address.

BOOL VirtualCopy(
  LPVOID lpvDest,
  LPVOID lpvSrc,
  DWORD cbSize,
  DWORD fdwProtect
);

标签:, , ,
HttpWebRequest WebResponse PROXY URLENCODE 2 代码 - 十二月 12, 2005 by yippee

HttpWebRequest WebResponse PROXY URLENCODE 2 代码

HttpWebRequest WebResponse PROXY URLENCODE 1
http://www.yippeesoft.com/blog/p/HttpWebReqRespPROXYURLENC1.php

模拟提交:
private void baidu_Click(object sender, System.EventArgs e)
&leftsign;
getPage("http://www.yippeesoft.com/blog/index.php", "job=showsearch&keywords=mysql");
&rightsign;

public static void getPage(String url, String payload)
&leftsign;
 WebResponse result = null; www.yippeesoft.com

 try
 &leftsign; www.yippeesoft.com

  HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
  req.Method = "POST"; www.yippeesoft.com
  req.ContentType = "application/x-www-form-urlencoded";
  req.Accept ="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
  StringBuilder UrlEncoded = new StringBuilder();
  Char[] reserved = &leftsign;\’?\’, \’=\’, \’&\’&rightsign;;
  byte[] SomeBytes = null;

  if (payload != null)
  &leftsign;
   int i=0, j;
   while(i<payload.Length)
   &leftsign;
    j=payload.IndexOfAny(reserved, i);
    if (j==-1) www.yippeesoft.com
    &leftsign;
     UrlEncoded.Append(HttpUtility.UrlEncode(payload.Substring(i, payload.Length-i)));
     break;
    &rightsign;
    UrlEncoded.Append(HttpUtility.UrlEncode(payload.Substring(i, j-i)));
    UrlEncoded.Append(payload.Substring(j,1));
    i = j+1;
   &rightsign;
   Trace.WriteLine(UrlEncoded.ToString());
   SomeBytes = Encoding.Default.GetBytes(UrlEncoded.ToString());
   SomeBytes = Encoding.Default.GetBytes( "stext=%CA%A2%B7%C5&imageField.x=22&imageField.y=7");
   //SomeBytes = Encoding.UTF8.GetBytes("s?wd=%CA%A2%B7%C5&cl=3");
   req.ContentLength = SomeBytes.Length;
   Stream newStream = req.GetRequestStream();
   newStream.Write(SomeBytes, 0, SomeBytes.Length);
   newStream.Close();
  &rightsign;
  else  www.yippeesoft.com
  &leftsign;
   req.ContentLength = 0;
  &rightsign;

www.yippeesoft.com
  result = req.GetResponse();
  Stream ReceiveStream = result.GetResponseStream();
  Encoding encode = System.Text.Encoding.GetEncoding("utf-8");
  StreamReader sr = new StreamReader( ReceiveStream, System.Text.Encoding.Default  );
  Trace.WriteLine("\\r\\n已接收到响应流");
  Char[] read = new Char[256];
  int count = sr.Read( read, 0, 256 );
  Trace.WriteLine("HTML…\\r\\n");
  while (count > 0)
  &leftsign;
   String str = new String(read, 0, count);
   Trace.Write(str);
   count = sr.Read(read, 0, 256);
  &rightsign;
  Trace.WriteLine("");
 &rightsign;
 catch(Exception e)  www.yippeesoft.com
 &leftsign;
  Trace.WriteLine( e.ToString());
  Trace.WriteLine("\\r\\n找不到请求 URI,或者它的格式不正确");
 &rightsign;
 finally
 &leftsign;
  if ( result != null )
  &leftsign;
   result.Close();
  &rightsign;
 &rightsign;
&rightsign; www.yippeesoft.com

标签:, , , , , , , ,
GOOGLE AdSense 代码 修改 - 十一月 25, 2005 by yippee

GOOGLE AdSense 代码 修改:

AdSense for Content
<script type="text/javascript"><!–
google_ad_client = "pub-3992897483323958";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468×60_as";
google_ad_type = "text_image";
google_ad_channel ="";
//–></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

AdSense for Search

<!– SiteSearch Google –>
<form method="get" action="http://www.google.com.sg/custom" target="_top">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" ></input>
<font size="-1" color="#000000">Web</font>
<input type="radio" name="sitesearch" value="www.yippeesoft.com" checked="checked"></input>
<font size="-1" color="#000000">YippeeSoft</font>
</td>
</tr>
</table>
<table border="0" bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left">
<input type="hidden" name="domains" value="www.yippeesoft.com"></input>
<input type="text" name="q" size="15" maxlength="255" value=""></input>
<input type="submit" name="sa" value="GOOGLE"></input>
<input type="hidden" name="client" value="pub-3992897483323958"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="UTF-8"></input>
<input type="hidden" name="oe" value="UTF-8"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="zh-CN"></input>
</td></tr>
<tr>
<td nowrap="nowrap">

</td></tr></table>
</form>
<!– SiteSearch Google –>

标签:, , ,
GOOGLE AdSense 代码 原始 - 十一月 25, 2005 by yippee

GOOGLE AdSense 代码.

AdSense for Content  

<script type="text/javascript"><!–
google_ad_client = "pub-3992897483323958";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728×90_as";
google_ad_type = "text_image";
google_ad_channel ="";
//–></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

AdSense for Search  

<!– SiteSearch Google –>
<form method="get" action="http://www.google.com.sg/custom" target="_top">
<table border="0" bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25wht.gif"
border="0" alt="Google"></img></a>
</td>
<td nowrap="nowrap">
<input type="hidden" name="domains" value="WWW.SHENGFANG.ORG"></input>
<input type="text" name="q" size="31" maxlength="255" value=""></input>
</td></tr>
<tr>
<td>&nbsp;</td>
<td nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="" checked="checked"></input>
<font size="-1" color="#000000">Web</font>
</td>
<td>
<input type="radio" name="sitesearch" value="WWW.SHENGFANG.ORG"></input>
<font size="-1" color="#000000">WWW.SHENGFANG.ORG</font>
</td>
</tr>
</table>
<input type="submit" name="sa" value="搜索"></input>
<input type="hidden" name="client" value="pub-3992897483323958"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="UTF-8"></input>
<input type="hidden" name="oe" value="UTF-8"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="zh-CN"></input>

</td></tr></table>
</form>
<!– SiteSearch Google –>

标签:, ,
PHP MYSQL 通用数据处理 JAVASCRIPT 传值 调用 代码 - 十一月 1, 2005 by yippee

PHP MYSQL 通用数据处理 JAVASCRIPT 传值 调用 PHP代码

PHP MYSQL 通用数据处理 JAVASCRIPT 传值 调用 HTML http://www.yippeesoft.com/blog/p/lampTYDATAjsphphtml.php
<html> www.yippeesoft.com
<HEAD>
<title>例子</title> www.yippeesoft.com
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<?php   www.yippeesoft.com
#setcookie("TestCookie", $value, time()+3600);  /* expire in 1 hour */
function GetDepart($id=0)
&leftsign; www.yippeesoft.com
  require_once(\’./adodb/ADOdb-errorhandler.inc.php\’);
  require_once("./adodb/ADOdb.inc.php");
  require_once(\’./adodb/tohtml.inc.php\’);
  $conn = &ADONewConnection(\’mysql\’);  # create a connection
  $conn->PConnect(\’localhost\’,\’root\’,\’123\’,\’bill\’);# connect to MySQL, agora db   
  $id=$_COOKIE[\'usersfsf\'];
  print_r($_COOKIE); //备注:测试使用
  echo "idd=\’$id\’;";  
  $sqll=\’select departmentname,departmentid  from departments  where companyid =  \’.$id;
  echo "sql=\’$sqll\’;";
  $recordSet = &$conn->Execute($sqll);
  #print $recordSet->GetMenu("sdfsd","",false);
  #rs2html($recordSet);
  #echo \’<Script LANGUAGE=JavaScript>\’;
  echo "var y=new Array();";
  $i=0; 
  while (!$recordSet->EOF)
  &leftsign;
   #$smenu[]  =  $recordSet->fields[0]; 
   $s=$recordSet->fields[0];
   echo "y[$i]=\’$s\’;";
   $i=$i+1;
   $recordSet->MoveNext();
  &rightsign;
  #echo "</script>";
  if  (!isset($smenu)  &&  is_array($smenu))
  &leftsign; 
   $str  =  implode(",",$smenu); 
   #echo \’<Script LANGUAGE=JavaScript>\’;
   echo "y=\’$str\’";
   #echo "</script>";
  &rightsign;
  unset($smenu);  //删除smenu变量 
&rightsign;
?>
<?php  www.yippeesoft.com
function GetCompanys($id=0)
&leftsign;
  require_once(\’./adodb/ADOdb-errorhandler.inc.php\’);
  require_once("./adodb/ADOdb.inc.php");
  require_once(\’./adodb/tohtml.inc.php\’);
  $conn = &ADONewConnection(\’mysql\’);  # create a connection
  $conn->PConnect(\’localhost\’,\’root\’,\’123\’,\’bill\’);# connect to MySQL, agora db   
  
  $recordSet = &$conn->Execute(\’select companyname,companyid  from companys\’);
  #print $recordSet->GetMenu("sdfsd","",false);
  #rs2html($recordSet);
  //echo \’<Script LANGUAGE=JavaScript>\’;
  echo "var companyname=new Array();";
  echo "var companyid=new Array();";
  $i=0; 
  while (!$recordSet->EOF)
  &leftsign;
   #$smenu[]  =  $recordSet->fields[0]; 
   $s=$recordSet->fields[0];
   echo "companyname[$i]=\’$s\’;";
   $s=$recordSet->fields[1];
   echo "companyid[$i]=\’$s\’;";
   $i=$i+1;
   $recordSet->MoveNext();
  &rightsign;
  //echo "</script>";
&rightsign;www.yippeesoft.com
 ?> 
 <?php www.yippeesoft.com
 function tt()
 &leftsign;
  $k="sdf";
  return $k;
 &rightsign;
 ?>
<SCRIPT LANGUAGE="JavaScript">

function sfsf()
&leftsign;
 var  khstr="<?=tt()?>"               //先将php变量转变成javascript变量khstr。
 alert(khstr);
&rightsign; www.yippeesoft.com
function  qwer2()
&leftsign;   www.yippeesoft.com
 
 <? GetCompanys()?>
 with  (document) 
 &leftsign; 
  
  for(i=all("mmenu").options.length;i>=0;i–)
  &leftsign; 
   all("mmenu").options.remove(i);  //需要清除原有的项目 
  &rightsign; 
  for(i=0;i<companyname.length;i++)
  &leftsign; 
   //obj1=document.createElement("option"); 
   //obj1.text=companyname[i]; 
   //obj1.value=companyid[i]; 
   var obj1=new Option(companyname[i],companyid[i]);
   all("mmenu").options.add(obj1); 
   
  &rightsign; 
 &rightsign; 
&rightsign; 
function  qwer(pSelect)
&leftsign;   www.yippeesoft.com
 expireDate = new Date ;
 //document.cookie="userName=\’"+pSelect+"\’; expires="+expireDate.toGMTString() ;
 delCookie("TestCookie");
 delCookie("usersfsf");
 alert(document.cookie);
 setCookie("usersfsf",pSelect);
 alert(document.cookie);
 <? GetDepart()?>
 alert(sql);
 alert(idd);
 with  (document) 
 &leftsign; 
  for(i=all("smenu").options.length;i>=0;i–)
  &leftsign; 
   all("smenu").options.remove(i);  //需要清除原有的项目 
  &rightsign; 
  for(i=0;i<y.length;i++)
  &leftsign; 
   obj=document.createElement("option"); 
   obj.text=y[i]; 
   all("smenu").options.add(obj); 
   
  &rightsign; 
 &rightsign; 
&rightsign; 
 www.yippeesoft.com
</script>
<select name="mmenu" onChange="qwer(this[this.selectedIndex].value)">

</select> 
<SCRIPT LANGUAGE="JavaScript">
function setCookie(name,value)
&leftsign;
 var Days = 30;
 var exp = new Date(); //new Date("December 31, 9998");
 exp.setTime(exp.getTime() + Days*24*60*60*1000);
 document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
&rightsign;  www.yippeesoft.com
function getCookie(name)
&leftsign;
 thisCookie=document.cookie.split("; ");
 for (i=0; i<thisCookie.length;i++)
 &leftsign;
  temp=thisCookie[i].split("=");
  //alert(temp);
  if(temp[0]==name)
   return temp[1];
  else
   return null;
  //alert("\’, and the value is \’"+thisCookie[i].split("=")[1]+"\’<BR>");  
 &rightsign;
 //var arr,reg=new RegExp("(^ &line; )"+name+"=([^;]*)(; &line;$)");
 /*var arr,reg=new RegExp("(^ &line; )"+name+"=([^;]*)(; &line;$)");
 alert(reg);
 if(arr=document.cookie.match(name))
  return unescape(arr[2]);
 else
  return null; */
&rightsign;  www.yippeesoft.com
function delCookie(name)
&leftsign;
 var exp = new Date();
 exp.setTime(exp.getTime() – 1);
 var cval=getCookie(name);
 if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
&rightsign;

//expireDate = new Date ;
//document.cookie="userName=sfsf; expires="+expireDate.toGMTString() ;
//setCookie("usersfsf","sssssssss");
//alert(getCookie("usersfsf"));
//uu="1234";
//alert(document.cookie);
<?php www.yippeesoft.com
 $value = \’something from somewhere\’;
 $uuu=$_COOKIE[\'usersfsf\'];
 #echo "uu=\’$uuu\’;";
?>
/*alert(uu);
delCookie("usersfsf");
alert(thisCookie);
if (document.cookie == "")
&leftsign;
 alert("There are no cookies here");
&rightsign;
else
&leftsign;  www.yippeesoft.com
 thisCookie=document.cookie.split("; ");
 alert(thisCookie);
 for (i=0; i<thisCookie.length;i++)
 &leftsign;
  temp=thisCookie[i].split("=");
  //alert(temp);
  //alert("Cookie name is \’:"+temp[0]);
  //alert("\’, and the value is \’"+thisCookie[i].split("=")[1]+"\’<BR>");  
 &rightsign;
&rightsign;
*/
qwer2();
</script> www.yippeesoft.com
<select  name="smenu">  //子菜单设计 
</select> 
<input name=\’sf\’ >
</html>

标签:, , , , , , , , , ,
iwas2-动态变量名 PHP代码优化 变量的变量 - 八月 22, 2005 by yippee

3.2.5 动态变量名
PHP允许用户动态的创建变量名。当程序运行时,使用特殊的符号可以创建新的变量名:

// store the name of the dynamic variable.
$scl_dynamic = \’\’str_name\’\';

// assign a value to the dynamic variable.
$$scl_dynamic = \’\'John\’\';  www.yippeesoft.com

echo "\\$str_name = $str_name\\n";

此程序将显示  www.yippeesoft.com

$str_name =John  www.yippeesoft.com

尽管动态变量名存在一些吸引使用的方面,但是我在二十年的编程经历中,从没有发现有使用它们的需要。数组的灵活性应该足以解决大多数有可能需要使用动态变量名的问题。  www.yippeesoft.com 我立即就发现使用它的必要了~

什么叫作变量的变量?根据PHP手册,变量的变量是指取得一个变量的值并把它作为另一个变量的变量名。这表述显得相当的直接,容易和那些在一个句子中使用“变量”这个词弄混淆。给一个简单的例子,你定义一个变量 — x 等于 this — 然后定义一个变量的变量,意味着你把 x 的值作为新变量的名, www.yippeesoft.com

这是原来的代码:

$username_=$db->GetParam("username");
        $password_=$db->GetParam("password");
        $sitename_=$db->GetParam("sitename"); www.yippeesoft.com
        $siteaddr_=$db->GetParam("siteaddr");
        $siteart_=$db->GetParam("siteart");
        $hotnum_=$db->GetParam("hotnum");
        $intronum_=$db->GetParam("intronum");  www.yippeesoft.com

var $params=array("username"," www.yippeesoft.com password","sitename","siteaddr","siteart",           
    "hotnum","intronum","newnum","pnum","sortnum","height","width", "style",);

function Show()
 &leftsign;  www.yippeesoft.com
  global $db; www.yippeesoft.com
  foreach ($this-> www.yippeesoft.com params as $varr)
  &leftsign;
   $varrr=$varr.\’_\’;
   $$varrr =$db->GetParam($varr);
  &rightsign; www.yippeesoft.com

省了多少事情~~~~~

标签:, , ,
VB写的管道重定向CVS4IIS里面的代码 - 七月 8, 2005 by yippee

Option Explicit
\’Capture the outputs of a DOS command
\’Author: Marco Pipino
\’marcopipino@libero.it
\’28/02/2002
\’Modified: Jason Stracner
\’19/08/2003

\’The CreatePipe function creates an anonymous pipe,
\’and returns handles to the read and write ends of the pipe.
Private Declare Function CreatePipe Lib "kernel32" ( _
          phReadPipe As Long, _
          phWritePipe As Long, _
          lpPipeAttributes As Any, _
          ByVal nSize As Long) As Long

\’Used to read the the pipe filled by the process create
\’with the CretaProcessA function
Private Declare Function ReadFile Lib "kernel32" ( _
          ByVal hFile As Long, _
          ByVal lpBuffer As String, _
          ByVal nNumberOfBytesToRead As Long, _
          lpNumberOfBytesRead As Long, _
          ByVal lpOverlapped As Any) As Long

\’Structure used by the CreateProcessA function
Private Type SECURITY_ATTRIBUTES
    nLength As Long
    lpSecurityDescriptor As Long
    bInheritHandle As Long
End Type

\’Structure used by the CreateProcessA function
Private Type STARTUPINFO
    cb As Long
    lpReserved As Long
    lpDesktop As Long
    lpTitle As Long
    dwX As Long
    dwY As Long
    dwXSize As Long
    dwYSize As Long
    dwXCountChars As Long
    dwYCountChars As Long
    dwFillAttribute As Long
    dwFlags As Long
    wShowWindow As Integer
    cbReserved2 As Integer
    lpReserved2 As Long
    hStdInput As Long
    hStdOutput As Long
    hStdError As Long
End Type

\’Structure used by the CreateProcessA function
Private Type PROCESS_INFORMATION
    hProcess As Long
    hThread As Long
    dwProcessID As Long
    dwThreadID As Long
End Type

\’This function launch the the commend and return the relative process
\’into the PRECESS_INFORMATION structure
Private Declare Function CreateProcessA Lib "kernel32" ( _
          ByVal lpApplicationName As Long, _
          ByVal lpCommandLine As String, _
          lpProcessAttributes As SECURITY_ATTRIBUTES, _
          lpThreadAttributes As SECURITY_ATTRIBUTES, _
          ByVal bInheritHandles As Long, _
          ByVal dwCreationFlags As Long, _
          ByVal lpEnvironment As Long, _
          ByVal lpCurrentDirectory As Long, _
          lpStartupInfo As STARTUPINFO, _
          lpProcessInformation As PROCESS_INFORMATION) As Long

\’Close opened handle
Private Declare Function CloseHandle Lib "kernel32" ( _
          ByVal hHandle As Long) As Long

\’Consts for the above functions
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const STARTF_USESTDHANDLES = &H100&
Private Const STARTF_USESHOWWINDOW = &H1

Private m_sCommand As String          \’Private variable for the CommandLine property
Private m_sOutputs As String          \’Private variable for the ReadOnly Outputs property

\’Event that notify the temporary buffer to the object
Public Event ReceiveOutputs(CommandOutputs As String)

\’This property set and get the DOS command line
\’It\’s possible to set this property directly from the
\’parameter of the ExecuteCommand method
Public Property Let CommandLine(DOSCommand As String)
    m_sCommand = DOSCommand
End Property

Public Property Get CommandLine() As String
    CommandLine = m_sCommand
End Property

\’This property ReadOnly get the complete output after
\’a command execution
Public Property Get Outputs()
    Outputs = m_sOutputs
End Property

Public Function ExecuteCommand(Optional CommandLine As String) As String
    Dim typeProcess_Information As PROCESS_INFORMATION    \’Process info filled by CreateProcessA
    Dim iReturn As Long                                   \’long variable for get the return value of the
                                                          \’API functions
    Dim typeStartupInformation As STARTUPINFO             \’StartUp Info passed to the CreateProceeeA
                                                          \’function
    Dim typeSecurityAttributes As SECURITY_ATTRIBUTES     \’Security Attributes passeed to the
                                                          \’CreateProcessA function
    Dim iReadPipeHandle As Long                           \’Read Pipe handle created by CreatePipe
    Dim iWritePipeHandle As Long                          \’Write Pite handle created by CreatePipe
    Dim iBytesReadFromReadPipe As Long                    \’Amount of byte read from the Read Pipe handle
    Dim sReadPipeBuffer As String * 256                   \’String buffer reading the Pipe

    \’if the parameter is not empty update the CommandLine property
    Debug.Print CommandLine
    If Len(CommandLine) > 0 Then
        m_sCommand = CommandLine
    End If
   
    \’if the command line is empty then exit whit a error message
    If Len(m_sCommand) = 0 Then
        m_sOutputs = "Command Line empty (1)"
        ExecuteCommand = m_sOutputs
        Exit Function
    End If
   
    \’Create the Pipe
    typeSecurityAttributes.nLength = Len(typeSecurityAttributes)
    typeSecurityAttributes.bInheritHandle = 1&
    typeSecurityAttributes.lpSecurityDescriptor = 0&
    iReturn = CreatePipe(iReadPipeHandle, _
              iWritePipeHandle, _
              typeSecurityAttributes, _
              0)
   
    If iReturn = 0 Then
        \’If an error occur during the Pipe creation exit
        m_sOutputs = "CreatePipe failed. Error: " & Err.LastDllError & " (2)"
        ExecuteCommand = m_sOutputs
        Exit Function
    End If
   
    \’Launch the command line application
    typeStartupInformation.cb = Len(typeStartupInformation)
    typeStartupInformation.dwFlags = STARTF_USESTDHANDLES Or STARTF_USESHOWWINDOW
    \’set the StdOutput and the StdError output to the same Write Pipe handle
    typeStartupInformation.hStdOutput = iWritePipeHandle
    typeStartupInformation.hStdError = iWritePipeHandle
    \’Execute the command
    iReturn& = CreateProcessA(0&, _
              m_sCommand, _
              typeSecurityAttributes, _
              typeSecurityAttributes, _
              1&, _
              NORMAL_PRIORITY_CLASS, _
              0&, _
              0&, _
              typeStartupInformation, _
              typeProcess_Information)
       
    If iReturn <> 1 Then
        \’if the command is not found ….
        m_sOutputs = "File or command not found (3)"
        ExecuteCommand = m_sOutputs
        Exit Function
    End If
   
    \’Now We can … must close the iWritePipeHandle
    iReturn = CloseHandle(iWritePipeHandle)
    m_sOutputs = ""
   
    \’Read the ReadPipe handle
    Do
        iReturn = ReadFile(iReadPipeHandle, _
                  sReadPipeBuffer, _
                  256, _
                  iBytesReadFromReadPipe, _
                  0&)
        m_sOutputs = m_sOutputs & Left(sReadPipeBuffer, iBytesReadFromReadPipe)
        \’Send data to the object via ReceiveOutputs event
        RaiseEvent ReceiveOutputs(Left(sReadPipeBuffer, iBytesReadFromReadPipe))
    Loop While iReturn <> 0
   
    \’Close the opened handles
    iReturn = CloseHandle(typeProcess_Information.hProcess)
    iReturn = CloseHandle(typeProcess_Information.hThread)
    iReturn = CloseHandle(iReadPipeHandle)
   
    \’Return the Outputs property with the entire DOS output
    ExecuteCommand = m_sOutputs
End Function

标签:, ,
一些有趣的脚本代码和有趣的网址2 - 六月 24, 2005 by yippee

继续 一些有趣的脚本代码和有趣的网址 :整理一下

<IFRAME src="http://appnews.qq.com/cgi-bin/news_qq_search?city=%B1%B1%BE%A9"   frameBorder=0 width=157 scrolling=no height=240></IFRAME> 查询天气 不过不准 :)

<a href="http://www.prchecker.info/" target="_blank">
<img src="http://www.prchecker.info/PR1_img.gif" alt="Page Rank Checker" border="0"></a> 取得放置代码页面的PageRank值

<script type="text/j avascript" language="Javascript" src="http://data.booso.com/referrers.cgi"></script> http://blog.wespoke.com/archives/000571.html 只要将下面的代码加入您的网页,就能够在您的网页上显示反向联接,或者跟踪谁联接了您的网页

http://ip.wisa.com.cn/ 查询IP地址来源

http://whois.webhosting.info/  查找网站的一些信息

http://caishu.sina.com.cn/WebKZ.htm 名章篆刻

http://www.beifeng.net  热诚欢迎您光临闽南语音乐站-北风在线!

http://www.wztjq.com/mtv/  闽南语歌曲大全

http://www.uptimebot.com/sql/one.php http://www.086ok.com/seo/Main.aspx  查看网站收录情况

http://isnoop.net/gmail/  gmail申请

看看你的BLOG邻居 http://geourl.org/near?p=http://www.yippeesoft.com/blog/index.php

网站图标生成 http://phorum.com.tw/Generator.aspx

国内经纬度查询 http://www.webstellar.com/servings/search/search001.htm

国外经纬度查询 http://www.multimap.com/

网页翻译,支持中文简体、繁体、英文。。Website Translator  http://www.worldlingo.com/en/websites/url_translator.html

我的英文版本 http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=zh_en&url=http%3A%2F%2Fwww.yippeesoft.com/blog%2F  不过转向分类好像对长度有限制。

脸部评分网 http://www.faceanalyzer.com/ 外国人看脸相算命

http://www.flickr.com 国外的一个相册 我试验了YAHOO/163的,不知道这个显示图片会不会变成X

http://www.hotik.com/sign.png  个性签名图片,显示IP、天气、日期阴历阳历等

一个方便快洁制作免费Banner的工具站 http://www.bannerbreak.com/generate.php#

为BLOG添加投票系统  http://www.blogpoll.com/

标签:, ,