- 浏览: 680219 次
- 性别:
- 来自: 沈阳
文章分类
- 全部博客 (270)
- Ant Tool Script (12)
- XMLDigest (5)
- MyEclipse8.6 (1)
- RedHat (5)
- SVNVersionController (4)
- BatOperation (6)
- JspAndFaceWeb (66)
- javaSwing (18)
- PHP (12)
- J2SE (6)
- TestToolAndTestManual (12)
- C# (34)
- Java PatternDesign (20)
- Axis2AndWebService (5)
- ITLive (2)
- DBAndControl (10)
- C/C++ (8)
- Andriod (7)
- Python (7)
- JavaWork (16)
- Android-QA (1)
- Apache-Wicket (1)
- POI (1)
- JQuery (2)
- Struts2 (1)
- Flex&Flash (6)
- sdsdsd (0)
- 1212 (0)
最新评论
-
anayomin:
对九楼继续改进
public static <T> ...
Java List 分页 -
H4X0R:
来学习学习,赞一个
Aqua Data Studio 导出SQL -
yankai0219:
现在出现这个错误 Fatal error: Class 'PH ...
纯PHP搭建Apache+Eclipse+xDebug+PHPUnit+MakeGood -
yankai0219:
您好,我在搭建环境中提示PHPUnit_Framework_T ...
纯PHP搭建Apache+Eclipse+xDebug+PHPUnit+MakeGood -
wilsonchen:
chenhailong 写道wilsonchen 写道chen ...
C# RSA和Java RSA互通
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace FileTokenNotWork { public partial class Form1 : Form { FileStream fs = null; int count = 0; public Form1() { InitializeComponent(); } private void btnUpdate_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.ShowDialog(); filedirtectory.Text = ofd.FileName; } private void button1_Click(object sender, EventArgs e) { count++; if (count > 1) { MessageBox.Show("Do not do it again.","Warning",MessageBoxButtons.OK,MessageBoxIcon.Warning); return; } try { if (string.IsNullOrEmpty(filedirtectory.Text)) { MessageBox.Show("Not have the file", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); count--; return; } fs = new FileStream(filedirtectory.Text, FileMode.Open, FileAccess.Read, FileShare.None); } catch (Exception) { fs.Close(); } } private void button2_Click(object sender, EventArgs e) { count--; fs.Close(); } } }
namespace FileTokenNotWork { partial class Form1 { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.btnUpdate = new System.Windows.Forms.Button(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.filedirtectory = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // btnUpdate // this.btnUpdate.Location = new System.Drawing.Point(175, 20); this.btnUpdate.Name = "btnUpdate"; this.btnUpdate.Size = new System.Drawing.Size(75, 23); this.btnUpdate.TabIndex = 0; this.btnUpdate.Text = "submit"; this.btnUpdate.UseVisualStyleBackColor = true; this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click); // // openFileDialog // this.openFileDialog.FileName = "openFileDialog"; // // filedirtectory // this.filedirtectory.Location = new System.Drawing.Point(18, 22); this.filedirtectory.Name = "filedirtectory"; this.filedirtectory.Size = new System.Drawing.Size(134, 21); this.filedirtectory.TabIndex = 1; // // groupBox1 // this.groupBox1.Controls.Add(this.filedirtectory); this.groupBox1.Controls.Add(this.btnUpdate); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(268, 65); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Find file directory"; // // groupBox2 // this.groupBox2.Controls.Add(this.button2); this.groupBox2.Controls.Add(this.button1); this.groupBox2.Location = new System.Drawing.Point(12, 97); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(268, 98); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "lock file"; // // button1 // this.button1.Location = new System.Drawing.Point(28, 37); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; this.button1.Text = "lock"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(144, 37); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 23); this.button2.TabIndex = 1; this.button2.Text = "release"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(290, 204); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "Form1"; this.Text = "LockFileTool"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Button btnUpdate; private System.Windows.Forms.OpenFileDialog openFileDialog; private System.Windows.Forms.TextBox filedirtectory; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button1; } }
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace FileTokenNotWork { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
发表评论
-
减少winform的内存使用量
2013-06-01 06:49 1129今天看到有趣的代码,功能主要是减少winform的内存使用量。 ... -
C# Timer运行时,系统时间修改
2012-10-19 15:55 2868今天遇到一个问题: C# Time 运行的时候,将系统时间修 ... -
C# 一步一步的开始
2012-09-09 11:02 0------------------------------- ... -
C# 书写window简单服务
2012-03-30 19:59 1231代码如下: using System.Co ... -
手工添加window 服务依赖
2012-03-29 15:11 1907这里是bat文件 复制就可以添加 ... -
Services do not start and Event ID 7022
2012-03-29 15:07 1385今天遇到一个问题 具体的如题 解决方案: ... -
C# 读2007Excel文件
2012-03-27 13:51 2373今天遇到一个问题: C# ... -
C# 胡乱实现,程序 占用CPU50%
2012-02-28 07:05 3691今天早上看到了编程之美,我很兴奋,大早上看书,有吗? 有木有? ... -
IIS not work because of Com+ Application error or IWAM user not have password
2012-02-24 16:19 1738今天遇到了一个问题。XP的IIS 5.1 安装成功后会出现: ... -
IIS 7.0 HTTP Error 403.14
2012-02-23 13:09 1482刚才碰到一个问题:如题 下面是解决方案: 方法 ... -
C# Chart详细解析(待)
2012-02-07 19:25 54898一年有过去了, 很长时间也没有写什么文章了,准确的说是2个月, ... -
ProcessBar 2种经典实现
2011-12-15 14:05 1128我今天实装了ProcessBar 的两种实现方式 下面 ... -
winform 让事件提前运行
2011-12-15 13:54 1584今天遇到了一个问题,就是让Winform中的事件提前运行的问题 ... -
using C# modify app.config in the run time
2011-12-13 11:19 1322今天在印度的网站上发现一个很经典的代码,也对比了国内的网站的答 ... -
winform 方向键焦点丢失问题(keydown event not work)
2011-12-10 11:47 1923在项目中遇到了,方向键不能被keydown event 捕捉的 ... -
Windows Install SQL Manager Error
2011-11-21 09:52 1063在安装SQL Manager的时候会出现异常,是由于操作系统的 ... -
C# 文件Copy 不包含.svn文件
2011-11-18 11:48 1819今天遇到了C#文件copy的问题 现在写出了解决方案 ... -
实现winform 代码导入dll
2011-11-14 14:48 1479代码如下: [DllImport(" ... -
C# winform 应用程序只打开一次(实现)
2011-11-14 13:43 6998winform 有的时候只能打开一次,下一次不要打开的应用 ... -
.net 3.5 Form Chart 解决方案
2011-11-12 16:49 1695刚刚写了一篇关于自己生活的文章,下面写下,最近我一直在做个项目 ...
相关推荐
学生个人文件管理系统 v2.0 A.声明: 1.非源代码。 2.有些用户没有设置自己的数据库服务器就直接登录或者注册,这样是不会成的, 请选择自定义服务器,然后填入自己的IP,数据库用户名以及密码,因为默认服 ...
本系统以 C/S 架构采用 Socket 技术开发,可以运用本软件在局域网中实施监控管理。服务器端可以实时观察远程...除了这些,服务器端可以执行更高级的操作:即浏览客户端文件系统,并可以任意拷贝指定的客户端目录。
首先大家需要到码云里面找到如下图所示的文件锁的项目,如下图所示 下载下来以后导入到Visual Studio中,如下图所示,这个项目是用C#写的,所以你可以直接阅读的 接着运行这个C#项目,就可以看到如下图所示的加索...
程序演示了如何通过代码(不使用InstallUtil.exe)来对C#开发的Windows系统服务程序进行安装和卸载,使用了单独编写的安装程序,安装和卸载在线程中进行,带进度条,界面不锁死。 代码中的解决方案包括2个项目:...
c# repeater 锁表头 一、将表头与内容分离。 此方法的思路其实很简单,就是将表头放在一个表格中,将表单内容repeater放在一个DIV中 ,再将DIV的样式高度设为定值,并将此div设置为允许出现纵向滚动条。这种方法...
ManualResetEvent是一个超时等待的线程锁,如果超时返回false,接收指令显示true,但是没法实现在超时后让他继续等待,这种需求我们可以用在以下场景: 控制线程超时方法 1.[主线程]:请求方发送请求,立即创建超时等待...
实例073 使用C#操作INI文件 255 实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 ...
15.4 接口的实现 .182 15.5 抽象类与接口 .195 15.6 小 结 .196 第十六章 组织应用程序 .198 16.1 基 本 概 念 .198 16.2 使用名字空间 .200 16.3 使用指示符 .203 16.4 程 序 示 例 .206 16.5 小 ...
实例073 使用C#操作INI文件 255 实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 ...
实例073 使用C#操作INI文件 255 实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 ...
和 C++ 有所区别的是,C# 中没有单独的声明(头)和实现(CPP)文件。所有代码(类声明和实现)都放在扩展名为 cs 的单一文件中。 看看 C# 中的 Hello World 程序。 复制内容到剪贴板 代码: using System; ...
用C#语言实现一个文件夹锁的程序,网上类似的“xxx文件夹xxx”软件很多,但是基本上都是C/C++语言实现的,且都没有提供源码(这个可以理解,毕竟是加密程序,不应该泄露源码)。 程序的基本原理是:用C#语言重命名...
实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 第8章 网络开发应用 实例079 局域网...
实例073 使用C#操作INI文件 255 实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 ...
实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 第8章 网络开发应用 实例079 局域网...
实例073 使用C#操作INI文件 255 实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 ...
实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 第8章 网络开发应用 实例079...
(2)实例执行文件位置:TM\06\MrCy\MrCy\bin\Debug\ MrCy.exe (3)本系统共分为三种操作权限,分别为超级管理员、经理、一般用户: 一般用户: 一般用户只可以对辅助工具菜单、系统设置菜单、窗口布局菜单及帮助...
摘抄了里面两个问题,还有120个,真的很不错 1.维护数据库的完整性、一致性、...SqlServer自动锁定特定记录、字段或文件,防止用户访问,以维护数据安全或防止并发数据操作问题,锁可以保证事务的完整性和并发性。
实例074 使用C#操作XML文件 257 实例075 创建PDF文档 261 实例076 批量将Word文档转换为HTML网页 263 实例077 Word目录提取工具 265 实例078 文件批量解压缩 269 第8章 网络开发应用 实例079 局域网...