前沿速递

路漫漫其修远矣,吾将上下而求索! 汤建军欢迎你...
随笔 - 5, 文章 - 6, 评论 - 35, 引用 - 0
数据加载中……

2004年9月17日

看来我只不过是三把手

昨天收到微软的邮件:
获奖通知及邀请函 尊敬的汤建军先生您好: 祝贺您!! 我们非常高兴地通知您,您在2004年7-9月举行的MVP中国大陆地区评选 [http://www.microsoft.com/china/community/professional/mvp-2004-9.aspx> 中,经过几轮评选,您荣膺Microsoft MVP(微软最有价值专家)称号!您高超的技术水平和乐于与他人分享您的知识的精神给我们留下了深刻的印象。微软公司非常荣幸地授予您2003 Microsoft Most Valuable Professional (MVP) 奖项。本次评选,中国大陆地区共有58位专家获得此殊荣。 微软公司诚挚地邀请您出席9月29号在上海举行的中国区微软最有价值专家峰会。届时,微软高层和来自总部的贵宾将为新当选的MVP颁奖。 我们相信本次峰会能为建立和加强微软公司与微软最有价值专家之间的联系和友谊提供一个宝贵的机会。同时,我们也邀请了60多位目前在任的MVP出席颁奖仪式。殷切期望您能出席本次微软最有价值专家峰会,和100位全国的技专家交朋友。.....
才知道我当了MVP,希望今后能更好的为大家服务!
本来想同老婆大人一同到上海,让领导买点喜欢的东东,没想到女儿强烈反对,看来只好自己去了!根据昨天讨论的结果得出结论:在我家中,第一把是:女儿,第二把是:老婆.我只能排第三了!
最后谢谢在社区中支持我的所有朋友!谢谢杨云,同时期待在上海与你见面!不见不散!!!

posted @ 2004-09-17 08:40 汤建军 阅读(1387) | 评论 (16)编辑

2004年9月14日

Web事件日志

Web事件日志
对Web程序需要写事件日志是一个日常非常需要的功能,下面介绍要注意的方面:
首先要处理Global.asax
/////////////////////ERROR////Global.asax
protected void Application_Error(Object sender, EventArgs e)
{
   string err = "schoolweb Application Error\n\n";
   err += "Request: " + Request.Url.ToString() + "\n\n";
   err += "Strack Trace: \n" + Server.GetLastError().ToString();
   SystemFrameworks.Error.Log(err);
}
其次要注意IIS权限:
//要把注册表里系统日志的对应项的写权限分配给IIS,2003要改注册表:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog 在这个键上点右键-》权限
点"添加"然后“高级”-》“立即查找”在里面有“IIS_WPG”用户,添加,然后该权限
如果还不好用就要改machine.config
将userName="machine" password="AutoGenerate"
改成userName="system" password="AutoGenerate"
最后是写一个类来统一处理:
/////////////////////
using System;
using System.Diagnostics;

namespace WinXiYu.DataAccess
{
 /// <summary>
 /// ErrorClass 的摘要说明。
 /// </summary>
 public class ErrorClass
 {
  const string EVENT_LOG_SOURCE = ".NET Costar";

  /// <summary>
  /// Log message to application log.
  /// </summary>
  /// <param name="message">Message to log.</param>
  public static void Log(string message)
  {
   EventLog m_eventLog = null;

   // make sure we have an event log
   if (!(EventLog.SourceExists(EVENT_LOG_SOURCE)))
   {
    EventLog.CreateEventSource(EVENT_LOG_SOURCE, "Application");
   }

   if (m_eventLog == null)
   {
    m_eventLog = new EventLog("Application");
    m_eventLog.Source = EVENT_LOG_SOURCE;
   }
   
   // log the message
   m_eventLog.WriteEntry(message, System.Diagnostics.EventLogEntryType.Error);
  }
 }
}

posted @ 2004-09-14 10:02 汤建军 阅读(776) | 评论 (1)编辑

Microsoft Visual Studio .NET 2003 引导程序插件

昨天在微软网站看到一个插件,用于在 Microsoft® Visual Studio® .NET 2003 中创建包含 .NET Framework 1.1 版和/或 Microsoft Data Access Components (MDAC) 2.7 版的部署项目。通过 Microsoft Visual Studio .NET 2003 引导程序插件,您可以轻而易举地创建安装程序,将 .NET Framework 1.1 和/或 MDAC 2.7 随您的应用程序一起重新分发。
它的下载网址是:http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=627921a0-d9e7-43d6-a293-72f9c370bd19
另外也可到http://www.gotdotnet.com/workspaces/workspace.aspx?id=2f8f0a23-f529-4158-8e0a-d187d16f41f1
具体打制做安装程序相关操作请参考微软提供的下面方法:

To install the .NET Framework with a Setup project

  1. Make sure that the Visual Studio .NET Framework Bootstrapper Plug-in is installed.
  2. Select the Setup project in Solution Explorer. On the Project menu, choose Properties.
  3. Set the Bootstrapper property to Windows Installer Bootstrapper.

    The .NET Framework redistributable will be packaged with the Setup.exe for the Setup project when it is built.

    Note   The .NET Framework launch condition must also be enabled; it is enabled by default for any project that references the .NET Framework. To check for the launch condition, from the View menu, point to Editor and choose Launch Conditions, then look for a launch condition named .Net Framework.

To install MDAC with a Setup project

  1. Make sure that the Visual Studio .NET Framework Bootstrapper Plug-in is installed.
  2. Select the Setup project in Solution Explorer. From the View menu, point to Editor and choose Launch Conditions.
  3. Select the Requirements on Target Machine node. From the Action menu, choose Add Registry Launch Condition.
  4. Select the Search for RegistryEntry1 node. In the Properties window, select the RegKey property and type Software\Microsoft\DataAccess.
  5. Select the Root property and select vsdrrHKLM.
  6. Select the Value property and type FullInstallVer.
  7. Select the Property property and type MDACSEARCH.
  8. In the Launch Conditions Editor, select the Condition1 node. In the Properties window, select the Condition property and select MDACSEARCH>="2.6".
  9. Select the Setup project in Solution Explorer. On the Project menu, choose Properties.
  10. Set the Bootstrapper property to Windows Installer Bootstrapper.

    Both the .NET Framework redistributable and MDAC will be packaged with the Setup.exe for the Setup project when it is built.

它的网址是:Using Visual Studio .NET 2003 to Redistribute the .NET Framework
http://msdn.microsoft.com/vstudio/downloads/tools/bootstrapper/default.aspx?pull=/library/en-us/dnnetdep/html/vsredistdeploy1_1.asp

posted @ 2004-09-14 08:41 汤建军 阅读(1126) | 评论 (2)编辑

2004年9月3日

NET框架WINDOWS FORM类

这里为了让大家更好的学习.net中的类我把这个类的列表传给大家希望大家能够喜欢

posted @ 2004-09-03 15:02 汤建军 阅读(466) | 评论 (2)编辑

2004年9月2日

老地方,不一样的心情(在MDI窗体中显示子窗体的一个实例)

昨天晚上我又一次回到科技馆给同学们讲课,真是一样的地方不一样的心情!回首去年,我第一次来给大家讲课,当时的学生现阶段有的已经成为了项目经理,有的还在找寻工作.我在想为什么会有这么大的区别呢?.
现在我面对一些新的大学将毕业的学子,真希望他们能够早一点成才.希望在我指导他们实习的这段日子里,他们能够真正有所收获.代码,还是代码!就把今天讲的一段代码列出来吧!
应用程序入口及闪屏
using System;
using System .Windows .Forms ;

namespace WinInformation
{
 /// <summary>
 /// MainClass 的摘要说明。
 /// </summary>
 public class MainClass
 {
  /// <summary>
  /// 应用程序的主入口点。
  /// </summary>
  [STAThread]
  static void Main()
  {
   //闪屏
   SplashForm splashFrm=new SplashForm ();
   splashFrm.ShowDialog();
   //
   LogForm logFrm=new LogForm ();
   if(logFrm.ShowDialog ()==DialogResult .OK)
   {
    MainForm objMainForm=new MainForm ();
    objMainForm.strLogInf =logFrm.strUserInf ;
    Application.Run(objMainForm);
   }
   else
   {
    Application .Exit ();
   }
  }
 }
}
在主窗口中只显示子窗口的一个实例
private InfForm objInfForm;
private void LoadInfForm()
  {
   if(objInfForm==null||objInfForm.IsDisposed )
   {
    objInfForm=new InfForm ();
    objInfForm.MdiParent=this;
    objInfForm .WindowState=FormWindowState .Maximized ;
    objInfForm.Show();
   }
   else
   {
    objInfForm .Activate ();
    objInfForm .WindowState=FormWindowState .Maximized ;
   }
  }
=====================================================
* 我很真诚,但我生活在谎言之中。                  *
* 我抛弃了所有的忧伤与疑虑,去追逐那无家的潮水,    *
* 终于找到了一个爱我的女人,从此失去了自由!       *
*[csharp|dotnet.VB|dotnet.VC|dotnet.framework]斑竹  *
* http://www.cnblogs.com/satan%20tang/  汤建军     *
=====================================================

posted @ 2004-09-02 08:44 汤建军 阅读(1124) | 评论 (13)编辑