摘要: 安装包操作IIS的代码实例: #region private void CreateVirtualDir() { try { string constIISWebSiteRoot = "IIS://" + iis + "/W3SVC/1/ROOT"; DirectoryEntry root = new DirectoryEntry(constIISWebSiteRoot); DirectoryEntry newRoot = root.Children.Add(port, root.SchemaClassName); newRoot.Properties[ 阅读全文
posted @ 2012-01-31 15:11 踏浪帅 阅读(1219) 评论(0) 推荐(0)
摘要: 做了一个web的打包程序,和大家分享一下。第一步:新建——文件——项目,弹出对话框如图,选择安装和部署——安装项目这里要解释一下了,一般来说,制作web安装程序选择web安装项目,而我没有选择web安装项目的原因是web安装项目制作出来的安装包是不可以选择软件的安装路径的,而安装项目制作出来的安装包是可以选择软件的安装目录的。第二步:右键解决方案中的安装项目——视图——文件系统如图弹出 这样的文件系统界面,将你发布完的文件复制到应用程序文件夹下第三步:右键解决方案中的安装项目——视图——用户界面(和第二步一样,不截图了)弹出下图其中客户信息根据项目需求可有可无,文本框(A)文本框(B)要是配置 阅读全文
posted @ 2012-01-31 14:20 踏浪帅 阅读(784) 评论(0) 推荐(0)
摘要: 安装包一些整理:1:制作web安装程序选择web安装项目,而我没有选择web安装项目的原因是web安装项目制作出来的安装包是不可以选择软件的安装路径的,而安装项目制作出来的安装包是可以选择软件的安装目录的。2:string dir = this.Context.Parameters["targetdir"].ToString(); 这个是获得网站安装的目录地址;3:给安装的目录设置everyone权限操作(代码写在安装程序类中); 从targetdir获得安装后的地址然后设置权限;代码如下: public override void Install(IDictionary 阅读全文
posted @ 2012-01-31 14:19 踏浪帅 阅读(467) 评论(0) 推荐(0)
摘要: 绝对路径: protected void Button1_Click(object sender, EventArgs e) { try { string filename = @"E:\k"; //目标目录 string account = @"Everyone";//用户名 string userrights = @"F";//权限字符串,自己定义的 AddDirectorySecurity(filename, account, userrights); } catch (Exception ex) { } } static pu 阅读全文
posted @ 2012-01-31 10:21 踏浪帅 阅读(316) 评论(0) 推荐(0)
摘要: MSDN Blogs > Go with the Flow > WorkflowInvoker,WorkflowApplication和WorkflowServiceHost WorkflowInvoker,WorkflowApplication和WorkflowServiceHost Hong Wang 3 Feb 2010 6:08 PM Comments 0Workflow 4.0是个全新的框架,重写了3.0/3.5中的的Runtime和Activity。在Workflow 4.0的Runtime和3.0/3.5中的Runtime的最大区别在于没有了WorkflowRunti 阅读全文
posted @ 2012-01-10 15:03 踏浪帅 阅读(644) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;namespace WindowsFormsApplication1{ /// <summary> /// WriteInLog 的摘要说明。 /// </summary> public class WriteInLog { private string logFileName; private int logFileSizes; /// <summary> /// 写入日志文件 /// </s 阅读全文
posted @ 2011-12-28 15:21 踏浪帅 阅读(241) 评论(0) 推荐(0)
摘要: 准备工作:数据表:Table1 ID int PKCol1 varchar(50)Col2 int======================================Table2ID int PKoID int FKRemarks varchar(50)======================================方法简介:1. 查询DBContext dc = new DBContext(); //实例化Linq To SQL 类 var s = from t1 in dc.Table1 select... 阅读全文
posted @ 2011-12-22 15:38 踏浪帅 阅读(223) 评论(0) 推荐(0)
摘要: namespace ConsoleApplication3{ class Program { static void Main(string[] args) { Model1Container m = new Model1Container(); Student s = new Student(); s.Name = "小明"; m.Student集.AddObject(s); //增加操作 m.SaveChanges(); //运行增加 Console.WriteLine("增加成功"); var Slist = from Stu in m.Stude 阅读全文
posted @ 2011-12-22 10:08 踏浪帅 阅读(597) 评论(0) 推荐(0)
摘要: 效果图:说明:此示例在.net2005\xp下运行通过示例程序是同步套接字程序,功能很简单,只是客户端发给服务器一条信息,服务器向客户端返回一条信息;这里只是一个简单的示例,是一个最基本的socket编程流程,在接下来的文章中,会依次记录套接字的同步和异步,以及它们的区别。下面是示例程序的简单步骤说明服务器端:第一步:用指定的端口号和服务器的ip建立一个EndPoint对像;第二步:建立一个Socket对像;第三步:用socket对像的Bind()方法绑定EndPoint;第四步:用socket对像的Listen()方法开始监听;第五步:接受到客户端的连接,用socket对像的Accept() 阅读全文
posted @ 2011-12-07 17:09 踏浪帅 阅读(829) 评论(0) 推荐(0)
摘要: 做个参考吧,跟之前的有个问题类似HTML code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title></head><body> < 阅读全文
posted @ 2011-12-07 11:26 踏浪帅 阅读(572) 评论(0) 推荐(0)