Archive for April, 2007

BlowFish算法封装

前面一个帖子一样,只是为了使用方便,把别人已经写好的BlowFish加密算法封装了一下。

点击这里下载(VS2005)

VS2005打包问题终于搞定

参考:

http://msdn2.microsoft.com/en-us/library/ms235291(VS.80).aspx

Deploying Visual C++ library DLLs as private assemblies

In this scenario, the application is deployed by just copying a folder from the development computer to the target computer, and installing dependent assemblies as private side-by-side assemblies. To deploy Visual C++ libraries as private assemblies, perform the following steps:

Steps

  1. Create a folder structure on the development computer that matches the folder structure to be used on the target computer. For this example, create a \bin folder and copy myapplication.exe there. Then create a \bin\mylibrary folder and copy MyLibrary.dll there.
  2. On the development computer, from %PROGDIR%\Microsoft Visual Studio 8\VC\Redist\x86, copy Microsoft.VC80.CRT and Microsoft.VC80.MFC to \bin and to \bin\MyLibrary.

    NoteNote
    Visual C++ Express does not create %PROGDIR%\Microsoft Visual Studio 8\VC\Redist\ during installation on the development computer. To redistribute Visual C++ libraries with applications built with Visual C++ Express, please use Visual C++ Redistributable Packages (VCRedist_*.exe). See section "Deploying Visual C++ library DLLs as shared assemblies" above for more information.

    NoteNote
    For deploying 64-bit applications to 64-bit operating systems, use \vc\redist\amd64 or \vc\redist\ia64.
  3. Copy the \bin folder to the target computer. On a target computer with manifest-based binding support (Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Vista) no further preparation is necessary. On a computer without such support (Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows 2000), Microsoft.VC80.CRT and Microsoft.VC80.MFC must be on the path.

    NoteNote
    For debug applications, use debug DLLs from \vc\redist\debug_nonredist\. However, remote debugging may not work for an application that deploys debug versions of Visual C++ libraries as private assemblies. For more information, see Preparing a Test Machine To Run a Debug Executable.

    NoteNote
    If you want to do remote debugging on the target machine, you must copy over the debug DLLs or follow the procedure to install debug DLLs in Preparing a Test Machine To Run a Debug Executable.

再也不用VS2005的Setup Project了,麻烦,并且要求目标机器安装Windows Installer,搜遍了半个地球,最后才在上面的文章中找到问题所在,上面的写的很复杂,其实就是几句话:

1:Copy X:\Program Files\Microsoft Visual Studio 8\VC\redist\x86下目录Microsoft.VC80.CRT和目录Microsoft.VC80.MFC中的所有文件到你的程序的路径下

2:没有2,完了。

How to upload a file with HTTP POST?

How to upload a file, e.g. music, image file to a webserver? To do this, there are several ways available: FTP, SFTP, and so on, usually FTP is the common one, almost all file servers support FTP, but the user must have a valid account in server, this will cause a lot of security issues, also it is not friendly for average users. The most easy and popular way is uploading in web pages, this is straight-forward, even a monkey can do it, just press the 'submit' button. But that enforces you to get your files uploaded in web pages, you'll feel tired if you have to upload dozens of files. So If we got a client which uploads files automatically for us, it will be a convenient tool.

This is an article that teaches you to make your tool for uploading files with http protocal step by step. I'll write this program in C++.

The idea behind ths program is simple,  it simulates a browser, and submmit files to sever using HTTP post.

To be continued...

Read the rest of this entry »

黑色汉堡

!今天在公司,把汉堡放在微波炉里面转了5分钟,竟然着火了,拿出来看看,已经黑了,愚人节也不能这么玩我啊,6块钱啊。