??2004-07-10 09:37:26 from http://tendant.mysmth.net
今天发现了原来eclipse 中也有emacs 键绑定的功能,haha
试用了一下发现真得很不错,建议喜欢emacs的兄弟使用。
使用方法:
window->perference->workbench£->keys->active configuraion
选emacs 就ok.
前一段偶也尝试使用emacs 中的jde,但是不是特别好用,可能是我自己还不太会用吧,不过最近也没有时间去整它了,就用eclipse 自带的这个功能就很不错了。
另外:小日本有人写了个eclipse 的emacs 插件,我试用了一下由于很多键冲突需要重新定义就没有再尝试了。它的主页在:http://park.ruru.ne.jp/ando/work/who/ee2e/。
在找这个东东时也在sourceforge 上发现了另外一个eclipse 编辑器功能增强插件。
2
Macromedia ColdFusion MX 7 Shipping on February 7 (Live on SYS-CON.TV) @ JDJ
- cfmx 7 new features
macromedia (nasdaq: macr) today announced the immediate availability of
using system;
using system.drawing;
using system.management;
using system.net;
using system.net.sockets;
using system.collections;
using system.componentmodel;
using system.windows.forms;
using system.data;
namespace mac_ip_name
{
/// <summary>
/// form1 的摘要说明。
/// </summary>
public class form1 : system.windows.forms.form
{
private system.windows.forms.label label4;
private system.windows.forms.groupbox groupbox1;
private system.windows.forms.textbox txtmac;
private system.windows.forms.textbox txtip;
private system.windows.forms.textbox txtname;
private system.windows.forms.label lblmac;
private system.windows.forms.label lblip;
private system.windows.forms.label lblname;
private system.windows.forms.button button1;
private system.windows.forms.button button2;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private system.componentmodel.container components = null;
public form1()
{
//
// windows 窗体设计器支持所必需的
//
initializecomponent();
//
// todo: 在 initializecomponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.dispose();
}
}
base.dispose( disposing );
}
#region windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void initializecomponent()
{
this.label4 = new system.windows.forms.label();
this.groupbox1 = new system.windows.forms.groupbox();
this.button2 = new system.windows.forms.button();
this.txtmac = new system.windows.forms.textbox();
this.txtip = new system.windows.forms.textbox();
this.txtname = new system.windows.forms.textbox();
this.lblmac = new system.windows.forms.label();
this.lblip = new system.windows.forms.label();
this.lblname = new system.windows.forms.label();
this.button1 = new system.windows.forms.button();
this.groupbox1.suspendlayout();
this.suspendlayout();
//
// label4
//
this.label4.autosize = true;
this.label4.font = new system.drawing.font("楷体_gb2312", 15f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.label4.forecolor = system.drawing.color.fromargb(((system.byte)(255)), ((system.byte)(128)), ((system.byte)(128)));
this.label4.location = new system.drawing.point(49, 16);
this.label4.name = "label4";
this.label4.size = new system.drawing.size(245, 26);
this.label4.tabindex = 7;
this.label4.text = "获取本机计算机名ip与mac";
//
// groupbox1
//
this.groupbox1.controls.add(this.button2);
this.groupbox1.controls.add(this.txtmac);
this.groupbox1.controls.add(this.txtip);
this.groupbox1.controls.add(this.txtname);
this.groupbox1.controls.add(this.lblmac);
this.groupbox1.controls.add(this.lblip);
this.groupbox1.controls.add(this.lblname);
this.groupbox1.controls.add(this.button1);
this.groupbox1.location = new system.drawing.point(16, 56);
this.groupbox1.name = "groupbox1";
this.groupbox1.size = new system.drawing.size(320, 208);
this.groupbox1.tabindex = 11;
this.groupbox1.tabstop = false;
this.groupbox1.text = "获取区";
//
// button2
//
this.button2.font = new system.drawing.font("宋体", 9f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.button2.location = new system.drawing.point(184, 160);
this.button2.name = "button2";
this.button2.size = new system.drawing.size(88, 32);
this.button2.tabindex = 18;
this.button2.text = "退出";
this.button2.click += new system.eventhandler(this.button2_click);
//
// txtmac
//
this.txtmac.backcolor = system.drawing.color.fromargb(((system.byte)(224)), ((system.byte)(224)), ((system.byte)(224)));
this.txtmac.font = new system.drawing.font("宋体", 9f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.txtmac.forecolor = system.drawing.color.fromargb(((system.byte)(255)), ((system.byte)(128)), ((system.byte)(0)));
this.txtmac.location = new system.drawing.point(128, 110);
this.txtmac.name = "txtmac";
this.txtmac.readonly = true;
this.txtmac.size = new system.drawing.size(168, 21);
this.txtmac.tabindex = 17;
this.txtmac.text = "";
//
// txtip
//
this.txtip.backcolor = system.drawing.color.fromargb(((system.byte)(224)), ((system.byte)(224)), ((system.byte)(224)));
this.txtip.font = new system.drawing.font("宋体", 9f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.txtip.forecolor = system.drawing.color.fromargb(((system.byte)(255)), ((system.byte)(128)), ((system.byte)(0)));
this.txtip.location = new system.drawing.point(128, 70);
this.txtip.name = "txtip";
this.txtip.readonly = true;
this.txtip.size = new system.drawing.size(168, 21);
this.txtip.tabindex = 16;
this.txtip.text = "";
//
// txtname
//
this.txtname.backcolor = system.drawing.color.fromargb(((system.byte)(224)), ((system.byte)(224)), ((system.byte)(224)));
this.txtname.font = new system.drawing.font("宋体", 9f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.txtname.forecolor = system.drawing.color.fromargb(((system.byte)(255)), ((system.byte)(128)), ((system.byte)(0)));
this.txtname.location = new system.drawing.point(128, 30);
this.txtname.name = "txtname";
this.txtname.readonly = true;
this.txtname.size = new system.drawing.size(168, 21);
this.txtname.tabindex = 15;
this.txtname.text = "";
//
// lblmac
//
this.lblmac.autosize = true;
this.lblmac.font = new system.drawing.font("宋体", 12f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.lblmac.forecolor = system.drawing.color.fromargb(((system.byte)(0)), ((system.byte)(0)), ((system.byte)(64)));
this.lblmac.location = new system.drawing.point(32, 112);
this.lblmac.name = "lblmac";
this.lblmac.size = new system.drawing.size(88, 22);
this.lblmac.tabindex = 14;
this.lblmac.text = "mac地址为:";
//
// lblip
//
this.lblip.autosize = true;
this.lblip.font = new system.drawing.font("宋体", 12f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.lblip.forecolor = system.drawing.color.fromargb(((system.byte)(0)), ((system.byte)(0)), ((system.byte)(64)));
this.lblip.location = new system.drawing.point(40, 72);
this.lblip.name = "lblip";
this.lblip.size = new system.drawing.size(80, 22);
this.lblip.tabindex = 13;
this.lblip.text = "ip地址为:";
//
// lblname
//
this.lblname.autosize = true;
this.lblname.font = new system.drawing.font("宋体", 12f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.lblname.forecolor = system.drawing.color.fromargb(((system.byte)(0)), ((system.byte)(0)), ((system.byte)(64)));
this.lblname.location = new system.drawing.point(24, 32);
this.lblname.name = "lblname";
this.lblname.size = new system.drawing.size(97, 22);
this.lblname.tabindex = 12;
this.lblname.text = "计算机名为:";
//
// button1
//
this.button1.font = new system.drawing.font("宋体", 9f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, ((system.byte)(134)));
this.button1.location = new system.drawing.point(48, 160);
this.button1.name = "button1";
this.button1.size = new system.drawing.size(88, 32);
this.button1.tabindex = 11;
this.button1.text = "点击获取";
this.button1.click += new system.eventhandler(this.button1_click_1);
//
// form1
//
this.autoscalebasesize = new system.drawing.size(6, 14);
this.clientsize = new system.drawing.size(352, 285);
this.controls.add(this.groupbox1);
this.controls.add(this.label4);
this.formborderstyle = system.windows.forms.formborderstyle.fixed3d;
this.maximizebox = false;
this.name = "form1";
this.startposition = system.windows.forms.formstartposition.centerscreen;
this.text = "ip,计算机名,mac查询";
this.groupbox1.resumelayout(false);
this.resumelayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[stathread]
static void main()
{
application.run(new form1());
}
private void button1_click_1(object sender, system.eventargs e)
{
string s="",mac="";
//
//name
//
string hostinfo = dns.gethostname();
//
//ip
system.net.ipaddress[] addresslist = dns.gethostbyname(dns.gethostname()).addresslist;
for (int i = 0; i < addresslist.length; i ++)
{
s += addresslist[i].tostring();
}
//
//mac
//
managementclass mc;
mc=new managementclass("win32_networkadapterconfiguration");
managementobjectcollection moc=mc.getinstances();
foreach(managementobject mo in moc)
{
if(mo["ipenabled"].tostring()=="true")
mac=mo["macaddress"].tostring();
}
txtname.text=hostinfo;
txtip.text=s;
txtmac.text=mac;
button1.enabled=false;
button2.focus();
}
private void button2_click(object sender, system.eventargs e)
{
application.exit();
}
}
}
因为业务需要,需要给公司部分终端进行登记,以保证授权终端能够登录业务系统,最好的方法就是记录下每台终端的mac地址来进行验证是否有授权。
下面是采用调用api的方式获取指定ip的终端的mac地址:
[dllimport("iphlpapi.dll")]
public static extern int sendarp(int32 dest, int32 host, ref int64 mac, ref int32 length);
//dest为目标机器的ip;host为本机器的ip
[dllimport("ws2_32.dll")]
public static extern int32 inet_addr(string ip);
public static string getnetcardaddress(string strip)
{
try
{
iphostentry host = dns.gethostbyname(system.environment.machinename);
int32 local = inet_addr(host.addresslist[0].tostring());
int32 remote = inet_addr(strip);
- 更多文章:
- · 获得网卡MAC地址和IP地址(VB.net)
- · 把Windows XP系统界面变成苹果MAC OS
- · [推荐]Java C/S mode --Client
- · 获得网卡MAC地址和IP地址(VB.net)
- · getThelocalMacAddress
- · linux修改MAC地址/locale
- · 把Windows XP系统界面变成苹果MAC OS
- · linux修改MAC地址/locale
- · 把Windows XP系统界面变成苹果MAC OS
- · HTML、PDF文件格式转换工具一览
- · ADOBE升级流量程序处理软件 增加支持PDF格式
- · 抛弃AdobeReader享受轻松阅读PDF
- · XML文件到RTF和PDF的转换
- · Exporting from Crystal Reports to PDF, Word, Excel and HTML
- · 用Adobe Acrobat解决PDF文件文字重叠的问题
- · 用PdfFactory轻松制作PDF电子文档
- · 用PdfFactory轻松制作PDF电子文档
- · 使用Java生成Pdf文档
- · object标签使用pdf插件打开中文文件的问题
- · HTML、PDF文件格式转换工具一览

