How to Enable AirPrint Service on Windows 7/Vista/XP (32-bit/64-bit)?

Posted by Tike on November 20, 2010

转载:http://jaxov.com/2010/11/how-to-enable-airprint-service-on-windows/

iOS 4.2 comes with a unique feature called AirPrint which allows you to print your documents, photos, emails and web-pages over a Wifi connection with your Apple iOS device. To enable iOS 4.2 AirPrint feature on Windows, follow the step-by-step guide below. This guide is applicable to Windows 7, Windows Vista and Windows XP users.

Prerequisites:
  • iTunes 10.1
  • Make sure the printer is setup as a shared printer on your local PC
  • Make sure you have full administrator privileges to enable/disable services on your PC
Steps to Enable AirPrint on Windows 7/Vista/XP:
  1. If you have 64-bit Windows OS, go to C:\Program Files (x86) and create a new folder called AirPrint as shown in the screenshot below:

    Enable AirPrint on Windows

    OR

  2. If you have 32-bit Windows OS, go to C:\Program Files and create a new folder called AirPrint as shown in the screenshot below:

    AirPrint on Windows 32-Bit

  3. Download AirPrint.zip from here (Mirror) and unzip it in the AirPrint folder you created in the above steps.

    Enable AirPrint on Windows

  4. Go to run and type "CMD" to open Command Prompt as shown in the screenshot below:

    Open Command Prompt in Windows

  5. Now use the following set of commands respective to your OS version:

    For 64-bit Windows OS:

    • sc.exe create AirPrint binPath= "C:\Program Files (x86)\AirPrint\airprint.exe -s" depend= "Bonjour Service" start= auto
    • sc.exe start AirPrint

    Enable AirPrint on Windows
    For 32-bit Windows OS:

    • sc.exe create AirPrint binPath= "C:\Program Files\AirPrint\airprint.exe -s" depend= "Bonjour Service" start= auto
    • sc.exe start AirPrint
  6. As soon as you will start the AirPrint service, Windows Firewall will prompt you allow or deny AirPrint features to be shared over networks. Click on Allow access button.

    Enable AirPrint on Windows

飓风视频加密工具 V8.08.08 简体中文绿色破解版

说明:

可以加密各种视频格式文件(wmv,avi,asf,mpg,rm,rmvb,mp4,flv,vob等),加密后的文件可以通过离线方式授权播放,也可以通过网络方式授权播放;支持500M以上大型视频文件的高效加密与解码播放;
1、进行各种认证授权,比如:播放密码与客户电脑硬件绑定、可以指定播放次数 、播放时间和截止日期等;
2、设置播放时断开网络,禁止用户通过远程共享或者远程翻录;
3、设置播放时禁止开启其他窗口,以便学员可以专心学习;
4、为视频部分增加水印;
5、指定是否可以提供免费试看试听
6、指定产品编号,以便用户可以管理多个文件,以免混乱;
7、您也可以限定用户在限定的机器上播放
10、可以防止屏幕录像和拷屏

 

下载地址:http://ishare.iask.sina.com.cn/f/5067447.html?from=like

软件开发的主要阶段与任务

软件开发阶段&任务
  01 需求调研
    需求调研计划安排
    需求调研记录
    需求设计
      草图设计 Balsamiq Mockups
    提交需求分析报告
    需求评审
      用户,技术,调研人员
  02 详细设计
    依据需求分析报告
    原型设计
      设计工具
        Axure RP pro
        flairbuilder
      UI设计
      标准化
        框架
        元素
        界面
        文字
    详细设计报告
      用例图
      流程图
    详设评审
  03 系统架构设计
    系统技术架构
    事件流程图
  04 技术开发
    前端开发
    后端开发
    测试
      后端测试
      功能测试
      测试报告
  05 交付试行
    培训工作
    安装工作
    开工大会
    阶段评审
    联合评审

需求调研与产品设计10条经验

源文http://www.hanjunxing.com/10-notes-of-demand-and-product-design#comment-7939

1.用80%的时间去研究需求,用20%的时间设计产品;

2.理解用户—>装成用户—>比用户还像用户—>改变你的用户;

3.高效使用产品设计工具会事 半功倍;

4.随时跟用户沟通,用户看到并认同了DEMO后需求变更的风险才开始降低;

5.随时跟技术沟 通,否则技术一句“不能实现”会否掉你N人/日的成果;

6.产品设计末期,你除了需要忙于修改产品,更重要的是对用户Say NO;

7.经常说:“这部分需求我们计划放在下一个版本中实现”;

8.重视的细节,不只是功能和界面,别忽略数据流转和容错;

9.技术只考虑“如何实现”,而你需要告诉他们“实现什么”;

10.需求评审时要散发出自己的气场,告诉所有人,这份需求文档是无懈可击的。

Ubuntu 源安装Oracle JAVA

1、增加源

sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”

2、更新源

sudo apt-get update
3、下载安装

sudo apt-get install sun-java6-bin sun-java6-jre

4、配置环境

4.1写入系统变量:
$sudo gedit /etc/environment

在文本编辑器里写入下面两行内容:
CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
JAVA_HOME=/usr/lib/jvm/java-6-sun

4.2将系统虚拟机的优先顺序也调整一下:
$sudo gedit /etc/jvm
在文本编辑器里将下面一句写在最顶部:
/usr/lib/jvm/java-6-sun

PowerShell 文件目录监视片段

摘自《Windows PowerShell 2.0应用编程最佳实践》

#pseventing 1.1
#filesystemwatcher
Add-PSSnapin pseventing 

$fsw = New-Object system.IO.FileSystemWatcher
$fsw.Path = [IO.Path]::GetTempPath()
$fsw.EnableRaisingEvents = $true 

Start-KeyHandler -CaptureCtrlC 

Connect-Event fsw changed,deleted -Verbose 

"watching $($fsw.path)"
"entering loop ... ctrl+C to exit"
$done = $false
while($events = @(Read-Event -Wait)){
   #read-event alays returns a cllection
   foreach($event in $events){
      switch($event.name){
          "ctrlc"{
            "cancelling..."
            $done = $true
            }
        "changed"{
            $event
            #$done = $true
        }
        "deleted"{
            $event
        }
      }
    }
    if($done -eq $true){
        break
    }
}    
调试结果如下图:
image 

delphi下的FileSystemWatcher,实现文件目录监控

{*******************************************************}
{                                                       }
{       FileSystemWatcher                               }
{                                                       }
{       版权所有 (C) 2007 solokey                       }
{                                                       }
{       http://blog.csdn.net/solokey                    }
{                                                       }
{*******************************************************}

unit FileSystemWatcher;

interface
uses
  Windows, Classes, SysUtils;

type
  TFileOperation = (foAdded, foRemoved, foModified, foRenamed);
  TFileDealMethod = procedure(FileOperation: TFileOperation; const FileName1,FileName2: string) of object;

  TNotifyFilter = (nfFileNameChange, nfDirNameChange, nfAttributeChange,
    nfSizeChange, nfWriteChange, nfAccessChange, nfCreationDateChange, nfSecurityChange);
  TNotifyFilters = set of TNotifyFilter;

  TNotificationBuffer =  array[0..4095] of Byte;

  PFileNotifyInformation = ^TFileNotifyInformation;
  TFileNotifyInformation = record
    NextEntryOffset: DWORD;
    Action: DWORD;
    FileNameLength: DWORD;
    FileName: array[0..0] of WideChar;
  end;

  TShellChangeThread = class(TThread)
  private
    FActived: Boolean;
    FDirectoryHandle: Cardinal;
    FCS: TRTLCriticalSection;
    FChangeEvent: TFileDealMethod;
    FDirectory: string;
    FWatchSubTree: Boolean;
    FCompletionPort: Cardinal;
    FOverlapped: TOverlapped;
    FNotifyOptionFlags: DWORD;
    FBytesWritten: DWORD;
    FNotificationBuffer: TNotificationBuffer;
  protected
    procedure Execute; override;
    procedure DoIOCompletionEvent;
    function ResetReadDirctory: Boolean;
    procedure Lock;
    procedure Unlock;
  public
    constructor Create(ChangeEvent: TFileDealMethod); virtual;
    destructor Destroy; override;
    procedure SetDirectoryOptions(Directory : String; Actived: Boolean; WatchSubTree : Boolean;
      NotifyOptionFlags : DWORD);
    property ChangeEvent : TFileDealMethod read FChangeEvent write FChangeEvent;
  end;

  TFileSystemWatcher = class(TComponent)
  private
    FActived: Boolean;
    FWatchedDir: string;
    FThread: TShellChangeThread;
    FOnChange: TFileDealMethod;
    FWatchSubTree: Boolean;
    FFilters: TNotifyFilters;
    procedure SetWatchedDir(const Value: string);
    procedure SetWatchSubTree(const Value: Boolean);
    procedure SetOnChange(const Value: TFileDealMethod);
    procedure SetFilters(const Value: TNotifyFilters);
    function  NotifyOptionFlags: DWORD;
    procedure SetActived(const Value: Boolean);
  protected
    procedure Change;
    procedure Start;
    procedure Stop;
  public
    constructor Create(AOwner : TComponent); override;
    destructor  Destroy; override;
  published
    property  Actived:Boolean  read FActived write SetActived;
    property  WatchedDir: string read FWatchedDir write SetWatchedDir;
    property  WatchSubTree: Boolean read FWatchSubTree write SetWatchSubTree;
    property  NotifyFilters: TNotifyFilters read FFilters write SetFilters;
    property  OnChange: TFileDealMethod read FOnChange write SetOnChange;
  end;

procedure  Register;

implementation

procedure  Register;
begin
  RegisterComponents('Samples', [TFileSystemWatcher]);
end;

{ TShellChangeThread }

constructor TShellChangeThread.Create(ChangeEvent: TFileDealMethod);
begin
  FreeOnTerminate := True;
  FChangeEvent := ChangeEvent;
  InitializeCriticalSection(FCS);
  FDirectoryHandle := 0;
  FCompletionPort := 0;
  inherited Create(True);
end;

destructor TShellChangeThread.Destroy;
begin
  CloseHandle(FDirectoryHandle);
  CloseHandle(FCompletionPort);
  DeleteCriticalSection(FCS);
  inherited Destroy;
end;

procedure TShellChangeThread.DoIOCompletionEvent;
var
  TempBuffer: TNotificationBuffer;
  FileOpNotification: PFileNotifyInformation;
  Offset: Longint;
  FileName1, FileName2: string;
  FileOperation: TFileOperation;
  procedure DoDirChangeEvent;
  begin
    if Assigned(ChangeEvent) and FActived then
      ChangeEvent(FileOperation, FileName1, FileName2);
  end;
  function  CompleteFileName(const FileName:string):string;
  begin
    Result := '';
    if Trim(FileName) <> '' then
      Result := FDirectory + Trim(FileName);
  end;
begin
  Lock;
  TempBuffer := FNotificationBuffer;
  FillChar(FNotificationBuffer, SizeOf(FNotificationBuffer), 0);
  Unlock;
  Pointer(FileOpNotification) := @TempBuffer[0];
  repeat
    with FileOpNotification^ do begin
      Offset := NextEntryOffset;
      FileName2 := '';
      case Action of
        FILE_ACTION_ADDED..FILE_ACTION_MODIFIED: begin
          FileName1 := CompleteFileName(WideCharToString(FileName));
          FileOperation := TFileOperation(Action - 1);
          DoDirChangeEvent;
        end;
        FILE_ACTION_RENAMED_OLD_NAME: begin
          FileName1 := CompleteFileName(WideCharToString(FileName));
          FileOperation := TFileOperation(Action - 1);
        end;
        FILE_ACTION_RENAMED_NEW_NAME: begin
          if FileOperation = foRenamed then begin
            FileName2 := CompleteFileName(WideCharToString(FileName));
            DoDirChangeEvent;
          end;
        end;
      end;
    end;
  Pointer(FileOpNotification) := Pointer(PChar(FileOpNotification) + OffSet);
  until Offset=0;
end;

procedure TShellChangeThread.Execute;
var
  numBytes: DWORD;
  CompletionKey: DWORD;
  PFOverlapped: POverlapped;
  TempDirectoryHandle: Cardinal;
  TempCompletionPort: Cardinal ;
begin

  while not Terminated do begin
    Lock;
    TempDirectoryHandle := FDirectoryHandle;
    TempCompletionPort := FCompletionPort;
    Unlock;
    if TempDirectoryHandle > 0  then begin
      PFOverlapped := @FOverlapped;
      GetQueuedCompletionStatus(TempCompletionPort, numBytes, CompletionKey, PFOverlapped, INFINITE);
      if CompletionKey = Handle then begin
        Synchronize(DoIOCompletionEvent);
        FBytesWritten := 0;
        FillChar(FNotificationBuffer, SizeOf(FNotificationBuffer), 0);
        ReadDirectoryChanges(FDirectoryHandle, @FNotificationBuffer, SizeOf(FNotificationBuffer), FWatchSubTree, FNotifyOptionFlags, @FBytesWritten, @FOverlapped, nil);
      end;
    end;
  end;
  PostQueuedCompletionStatus(TempCompletionPort, 0, 0, nil);
end;

procedure TShellChangeThread.Lock;
begin
  EnterCriticalSection(FCS);
end;

function TShellChangeThread.ResetReadDirctory: Boolean;
var
  TempHandle: Cardinal;
  TempCompletionPort: Cardinal;
begin
  Result := False;
  CloseHandle(FDirectoryHandle);
  PostQueuedCompletionStatus(FCompletionPort, 0, 0, nil);
  CloseHandle(FCompletionPort);

  TempHandle := CreateFile(PChar(FDirectory), GENERIC_READ or GENERIC_WRITE,
                            FILE_SHARE_READ or FILE_SHARE_WRITE or FILE_SHARE_DELETE,
                            nil, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS or FILE_FLAG_OVERLAPPED, 0);
  Lock;
  FDirectoryHandle := TempHandle;
  Unlock;

  if (GetLastError = ERROR_FILE_NOT_FOUND) or (GetLastError = ERROR_PATH_NOT_FOUND) then begin
    Lock;
    FDirectoryHandle := 0;
    FCompletionPort := 0;
    Unlock;
    Exit;
  end;

  TempCompletionPort := CreateIoCompletionPort(FDirectoryHandle, 0, Handle, 0);

  Lock;
  FCompletionPort := TempCompletionPort;
  Unlock;

  FBytesWritten := 0;
  FillChar(FNotificationBuffer, SizeOf(FNotificationBuffer), 0);
  Result := ReadDirectoryChanges(FDirectoryHandle, @FNotificationBuffer, SizeOf(FNotificationBuffer), FWatchSubTree, FNotifyOptionFlags, @FBytesWritten, @FOverlapped, nil);
end;

procedure TShellChangeThread.SetDirectoryOptions(Directory: String; Actived: Boolean;
  WatchSubTree: Boolean;  NotifyOptionFlags : DWORD);
begin
  FWatchSubTree := WatchSubTree;
  FNotifyOptionFlags := NotifyOptionFlags;
  FDirectory := IncludeTrailingBackslash(Directory);
  FActived := Actived;
  ResetReadDirctory;
end;

procedure TShellChangeThread.Unlock;
begin
  LeaveCriticalSection(FCS);
end;

{ TFileSystemWatcher }

procedure TFileSystemWatcher.Change;
begin
  if csDesigning in ComponentState then
    Exit;
  if Assigned(FThread) then begin
    FThread.SetDirectoryOptions(FWatchedDir, FActived, LongBool(FWatchSubTree), NotifyOptionFlags);
  end;
end;

constructor TFileSystemWatcher.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FActived := False;
  FWatchedDir := 'C:\';
  FFilters := [nfFilenameChange, nfDirNameChange];
  FWatchSubTree := True;
  FOnChange := nil;
end;

destructor TFileSystemWatcher.Destroy;
begin
  if Assigned(FThread) then
    FThread.Terminate;
  inherited Destroy;
end;

function TFileSystemWatcher.NotifyOptionFlags: DWORD;
begin
  Result := 0;
  if nfFileNameChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_FILE_NAME;
  if nfDirNameChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_DIR_NAME;
  if nfSizeChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_SIZE;
  if nfAttributeChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_ATTRIBUTES;
  if nfWriteChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_LAST_WRITE;
  if nfAccessChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_LAST_ACCESS;
  if nfCreationDateChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_CREATION;
  if nfSecurityChange in FFilters then
    Result := Result or FILE_NOTIFY_CHANGE_SECURITY;
end;

procedure TFileSystemWatcher.SetActived(const Value: Boolean);
begin
  if FActived <> Value then begin
    FActived := Value;
    Change;
    if FActived then
      Start
    else
      Stop;
  end;
end;

procedure TFileSystemWatcher.SetFilters(const Value: TNotifyFilters);
begin
  if FFilters <> Value then begin
    FFilters := Value;
    Change;
  end;
end;

procedure TFileSystemWatcher.SetOnChange(const Value: TFileDealMethod);
begin
  FOnChange := Value;
  if Assigned(FOnChange) and FActived then
    Start
  else
    Stop;
  Change;
end;

procedure TFileSystemWatcher.SetWatchedDir(const Value: string);
begin
  if not SameText(FWatchedDir, Value) then begin
    FWatchedDir := Value;
    Change;
  end;
end;

procedure TFileSystemWatcher.SetWatchSubTree(const Value: Boolean);
begin
  if FWatchSubTree <> Value then begin
    FWatchSubTree := Value;
    Change;
  end;
end;

procedure TFileSystemWatcher.Start;
begin
  if csDesigning in ComponentState then
    Exit;
  if Assigned(FOnChange) then begin
    FThread := TShellChangeThread.Create(FOnChange);
    FThread.SetDirectoryOptions(FWatchedDir, FActived, LongBool(FWatchSubTree), NotifyOptionFlags);
    FThread.Resume;
  end;
end;

procedure TFileSystemWatcher.Stop;
begin
  if csDesigning in ComponentState then
    Exit;
  if Assigned(FThread) then begin
    FThread.Terminate;
    FThread := nil;
  end;
end;

end.

使用C# SmtpClient& gmail发邮件

公司OA用户提出要将OA收件箱转发给外部Gmail邮箱中,尝试通过,将部分发件代码传上来。

参考:http://blogs.msdn.com/b/mariya/archive/2006/06/15/633007.aspx


using System;
using System.Net;
using System.Net.Mail;

namespace System.Net.Mail
{

class GmailSmtpClient
{

public string AccountName;//yourname@gmail.com

public string Password;//your gmail account's password

public string toAddress;//target email address

public string Subject; //email subject

public string Body;//email body

public void send()
{

SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
//gmail ssl port is 587,the 465 port can not be used.

client.EnableSsl = true;

MailAddress from = new MailAddress(AccountName, AccountName);

MailAddress to = new MailAddress(toAddress, toAddress);

MailMessage message = new MailMessage(from, to);

message.Body = Body;

message.Subject = Subject;

client.Credentials = new NetworkCredential(AccountName, Password);

try
{
client.Send(message);
}
catch (Exception ex)
{

}
}

}

}

测试时,采用了gmail 的465端口不通,在网上找了用587是可以发件。

最近忙着总部的三地五公司的网络整合

如题,各兄弟单位的网络都已形成。目前主要是对各兄弟单位的网络架构,IP规划进行调研。初步定为租用VPN线路与自建VPN相结合。主要是解决网络上应用系统环境的问题。

方案的论证就要召开几次会议,提出的问题不是专业性不强,就是杯葛态度太明显。看来还要依赖强势推进。

我的黑莓9700手机常用程序

我的黑莓9700手机常用的程序:
Aerize Alerts
Aerize WIFIX
AddOnis
WifiFileTransfer
SmartAlerts
QuickLaunch
wordpress for blackberry
139Mail
UC7.2
PocketInformat
Gmail
google map
google mobile app
Google sync
SmartWIFI
MeterBerry
BerryWeather
QuickPull
RepliGo Reader
SmsFilter
Autostartup
SwooshPhotos
Spb TV
BuddyGuard
Wunder Radio 继续阅读

Tribon系统的建模的关键点

tribon M3系统的培训工作可以看出如下几个关键点:1、建模前线型光顺工作
建模前线型值导入与光顺既是技术活又是经验活。一般培训公司只会教会你如何使用软件,而生产设计公司不会让你参与该项工作,因为这是他们核心技术的一部分。
2、建模前零件库的建立
与1项是雷同,这部分工作主要依赖于详细设计,也是建模工作前的基础工作。尤其是公用件的建立决定了后继生产过程中的成组技术的应用范围与深度。
3、建模后出图的标准及出图方法

继续阅读

maven 发布项目到nexus服务器中

首先对Nexus服务器的Repositories中的类型有个了解,主要分为group、Hosted、Proxy和Virtual四种类型。
我们只能用Hosted作为发布的目标仓库。
1、配置.m2/settings.xml

<servers>
  <server>
    <id>nexus-releases</id>
     <username>admin</username>
     <password>****</password>
  </server>
   <server>
     <id>nexus-snapshots</id>
     <username>admin</username>
     <password>****</password>
   </server>
 </servers>

2.配置项目POM.xml



nexus-releases
public
http://localhost:8080/nexus/content/repositories/releases


nexus-snapshots
Snapshots
http://localhost:8080/nexus/content/repositories/snapshots


3.发布项目
进入项目目录执行mvn deploy结束后,构件就自动加入到服务器中,其他项目就可以进行关联引用。

参考:
Maven2部署构件到Nexus时出现的Failed to transfer file错误
Maven2中需要注意的问题
maven deploy到nexus私服出错问题