string schLocation = "Conference Room 涂聚文约会你";
            string schSubject = "Business visit discussion约会";
            string schDescription = "Schedule description明天到深圳市福田區車公廟冶金大大廈約會";
            System.DateTime schBeginDate = Convert.ToDateTime("2/3/2012 10:00:00 PM");
            System.DateTime schEndDate = Convert.ToDateTime("2/3/2012 11:00:00 PM");

            
            String[] content = { "BEGIN:VCALENDAR",
                              "PRODID:-//Flo Inc.//FloSoft//EN",
                              "BEGIN:VEVENT",
                              "DTSTART:" + schBeginDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"), 
                              "DTEND:" + schEndDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"), 
                              "LOCATION:" + schLocation, 
                                "PRIORITY:1",
                                 "SEQUENCE:0",
	                            "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + schDescription,
                              "SUMMARY:" + schSubject, "PRIORITY:3", 
                            "SEQUENCE:0",
	                     "END:VEVENT", "END:VCALENDAR" };
            String [] contents1={"BEGIN:VCALENDAR",
                "PRODID:-//XYZ Corp//My Product//EN",
                "VERSION:2.0",
                "CALSCALE:GREGORIAN",
                "METHOD:PUBLISH",
                "X-WR-CALNAME:My Calendar",
                "X-WR-TIMEZONE:(GMT-05:00) Eastern Time (US & Canada)",
                "BEGIN:VEVENT",
                "DTSTART:20061021T100000Z",
                "DTEND:20061021T130000Z",
                "DTSTAMP:20090211T175526Z",
                "UID:5f98dfd5-ac72-4ae1-b3c2-799a4e7c91f9",
                "CLASS:PUBLIC",
                "CREATED:20071104T183833Z",
                "DESCRIPTION: My description text.",
                "LAST-MODIFIED:20071104T183833Z",
                "LOCATION:涂聚文约会你 地址:123 Anywhere Street\\; Anyplace, NJ 12345\\; US",
                "SEQUENCE:0",
                "STATUS:CONFIRMED",
                "SUMMARY: My summary text.",
                "TRANSP:OPAQUE",
                "END:VEVENT",
                "BEGIN:VEVENT",
                "DTSTART:20061101T170000Z",
                "DTEND:20061101T180000Z",
                "DTSTAMP:20090211T175526Z",
                "UID:6eaef015-eb90-4e94-8e6c-0003b928969a",
                "CLASS:PUBLIC",
                "CREATED:20071104T183833Z",
                "DESCRIPTION: My description for number 2.",
                "LAST-MODIFIED:20071104T183833Z",
                "LOCATION: 涂聚文约会你 地址:123 Anywhere Street\\; Anyplace, NJ 12345\\; US",
                "SEQUENCE:0",
                "STATUS:CONFIRMED",
                "SUMMARY: My summary for #2.",
                "TRANSP:OPAQUE",
                "END:VEVENT",
                "END:VCALENDAR"
            };

            String [] contents2={
                "BEGIN:VCALENDAR",
                "PRODID:-//XYZ Corp//My Product//EN",
                "VERSION:2.0",
                "CALSCALE:GREGORIAN",
                "METHOD:PUBLISH",
                "X-WR-CALNAME:My Calendar",
                "X-WR-TIMEZONE:(GMT-05:00) Eastern Time (US & Canada)",
                "BEGIN:VEVENT",
                "DTSTART:20061021T100000Z",
                "DTEND:20061021T130000Z",
                "DTSTAMP:20090211T175526Z",
                "UID:5f98dfd5-ac72-4ae1-b3c2-799a4e7c91f9",
                "CLASS:PUBLIC",
                "CREATED:20071104T183833Z",
                "DESCRIPTION: My description text.",
                "LAST-MODIFIED:20110721T105554Z",
            "LOCATION:涂聚文约会你",
            "SEQUENCE:0",
            "STATUS:CONFIRMED",
            "SUMMARY:Insert something",
            "TRANSP:OPAQUE",
            "BEGIN:VALARM",
            "ACTION:DISPLAY",
            "DESCRIPTION:This is an event reminder",
            "TRIGGER:-P0DT0H10M0S",
            "END:VALARM",
            "END:VEVENT",
            "BEGIN:VEVENT",
            "DTSTART:20110909T083000Z",
            "DTEND:20110909T103000Z",
            "DTSTAMP:20110722T004312Z",
            "UID:e5fhdjff6vakjftnl3l9vjs64k@google.com",
            "CREATED:20110721T105410Z",
            "DESCRIPTION:涂聚文明天到深圳市福田區車公廟冶金大廈約會",
            "LAST-MODIFIED:20110721T111008Z",
            "LOCATION:涂聚文约会",
            "SEQUENCE:1",
            "STATUS:CONFIRMED",
            "SUMMARY:Insert something",
            "TRANSP:OPAQUE",
            "BEGIN:VALARM",
            "ACTION:DISPLAY",
            "DESCRIPTION:Insert something",
            "TRIGGER:-P0DT0H10M0S",
            "END:VALARM",
            "END:VEVENT",
            "END:VCALENDAR"
            };

             String [] contents3={"BEGIN:VCALENDAR",
                    "PRODID:-//Google Inc//Google Calendar 70.9054//EN",
                    "VERSION:2.0",
                    "CALSCALE:GREGORIAN",
                    "METHOD:PUBLISH",
                    "X-WR-CALNAME:涂聚文约会你",
                    "X-WR-TIMEZONE:Insert something",
                    "X-WR-CALDESC:",
                    "BEGIN:VEVENT",
                    "DTSTART:20110909T180000Z",
                    "DTEND:20110909T200000Z",
                    "DTSTAMP:20110722T004312Z",
                    "UID:et53m4on1ii70en7uuv1thjr58@google.com",
                    "CREATED:20110721T105553Z",
                    "DESCRIPTION:",
                    "LAST-MODIFIED:20110721T105554Z",
                    "LOCATION:涂聚文约会你",
                    "SEQUENCE:0",
                    "STATUS:CONFIRMED",
                    "SUMMARY:Insert something",
                    "TRANSP:OPAQUE",
                    "BEGIN:VALARM",
                    "ACTION:DISPLAY",
                    "DESCRIPTION:This is an event reminder",
                    "TRIGGER:-P0DT0H10M0S",
                    "END:VALARM",
                    "END:VEVENT",

                    "BEGIN:VEVENT",
                    "DTSTART:20110909T083000Z",
                    "DTEND:20110909T103000Z",
                    "DTSTAMP:20110722T004312Z",
                    "UID:e5fhdjff6vakjftnl3l9vjs64k@google.com",
                    "CREATED:20110721T105410Z",
                    "DESCRIPTION:",
                    "LAST-MODIFIED:20110721T111008Z",
                    "LOCATION:Auckland",
                    "SEQUENCE:1",
                    "STATUS:CONFIRMED",
                    "SUMMARY:涂聚文约会你",
                    "TRANSP:OPAQUE",
                    "BEGIN:VALARM",
                    "ACTION:DISPLAY",
                    "DESCRIPTION:Insert something",
                    "TRIGGER:-P0DT0H10M0S",
                    "END:VALARM",
                    "END:VEVENT",

                    "END:VCALENDAR"
             };

             String [] contents4={"BEGIN:VCALENDAR",
                "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN",
                "VERSION:2.0",
                "METHOD:PUBLISH",
                "X-CALSTART:20100611T140000Z",
                "X-CALEND:20100711T201500Z",
                "X-WR-RELCALID:{0000002E-5A22-AA75-713B-5C3715764495}",
                "X-WR-CALNAME: World Cup Football Complete Match Schedule 2010 South Africa",
                "BEGIN:VEVENT",
                "CATEGORIES:World Cup Football Complete Match Schedule 2010 South Africa",
                "CLASS:PUBLIC",
                "CREATED:20100608T231102Z",
                "DESCRIPTION:Group A\nFollow MarkThisDate on Twitter   markthisdate", 
                "DTEND:20100611T154500Z",
                "DTSTAMP:20100513T100200Z",
                "DTSTART:20100611T140000Z",
                "LAST-MODIFIED:20100608T231102Z",
                "LOCATION:涂聚文约会你",
                "PRIORITY:5",
                "SEQUENCE:0",
                "SUMMARY:涂聚文约会你 地址:涂聚文明天到深圳市福田區車公廟冶金大廈約會",
                "TRANSP:TRANSPARENT",
                "UID:005ef5a170ab453276aad021756e5fde@dusystem.com",
                "X-MICROSOFT-CDO-BUSYSTATUS:FREE",
                "X-MICROSOFT-CDO-IMPORTANCE:1",
                "END:VEVENT",
                "BEGIN:VEVENT",
                "CATEGORIES:涂聚文约会你 地址:涂聚文明天到深圳市福田區車公廟冶金大廈約會",
                "CLASS:PUBLIC",
                "CREATED:20100608T231102Z",
                "DESCRIPTION:天下为公",
                "DTEND:20100611T201500Z",
                "DTSTAMP:20100513T100200Z",
                "DTSTART:20100611T183000Z",
                "LAST-MODIFIED:20100608T231102Z",
                "LOCATION:Cape Town ",
                "PRIORITY:5",
                "SEQUENCE:0",
                 "SUMMARY:Uruguay - France",
                "TRANSP:TRANSPARENT",
                "UID:9660590c514358c5bceed9e75bed0222@dusystem.com",
                "X-MICROSOFT-CDO-BUSYSTATUS:FREE",
                "X-MICROSOFT-CDO-IMPORTANCE:1",
                "END:VEVENT",
                "BEGIN:VEVENT",
                "CATEGORIES:涂聚文约会你 地址:World Cup Football Complete Match Schedule 2010 South Africa",
                "CLASS:PUBLIC",
                "CREATED:20100608T231102Z",
                "DESCRIPTION:不作為的官都在步步高升",
                "DTEND:20100612T131500Z",
                "DTSTAMP:20100513T100200Z",
                "DTSTART:20100612T113000Z",
                "LAST-MODIFIED:20100608T231102Z",
                "LOCATION:不作為的官都在步步高升",
                "PRIORITY:5",
                "SEQUENCE:0",
                "SUMMARY:Korea Republic - Greece",
                "TRANSP:TRANSPARENT",
                "UID:5a9eaca2435fb52e1c95ddb786f82efa@dusystem.com",
                "X-MICROSOFT-CDO-BUSYSTATUS:FREE",
                "X-MICROSOFT-CDO-IMPORTANCE:1",
                "END:VEVENT",
                "END:VCALENDAR"
                };

           String [] contents5={"BEGIN:VCALENDAR",
                "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN",
                "VERSION:2.0",
                "METHOD:PUBLISH",
                "X-MS-OLK-FORCEINSPECTOROPEN:TRUE",
                "BEGIN:VEVENT",
                "CLASS:PUBLIC",
                "CREATED:20120203T120222Z",
                "DESCRIPTION:Schedule description明天到深圳市福田區車公廟冶金大廈約會",
                "DTEND:20120203T150000Z",
                "DTSTAMP:20120203T120200Z",
                "DTSTART:20120203T140000Z",
                "LAST-MODIFIED:20120203T120222Z",
                "LOCATION:Conference Room 涂聚文约会你",
                "PRIORITY:1",//提醒时间
                "SEQUENCE:0",
                "SUMMARY:Business visit discussion约会",
                "TRANSP:OPAQUE",
                "UID:040000008200E00074C5B7101A82E00800000000B0D4B7BDAEE2CC01000000000000000010000000C05DF5EA2953C0499548F598C334C23C",
                "DESCRIPTION:X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN"+
	                ">\n<HTML>\n<HEAD>\n<META NAME=Generator CONTENT=MS Exchange Server ve"+
	                "rsion 08.00.0681.000>\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n<!-- Converted f"+
	                "rom text/plain format -->\n\n<P>Schedule description明天到深圳市福"+
	                "田區車公廟冶金大大廈約會\n</P>\n\n</BODY>\n</HTML>",
                "X-MICROSOFT-CDO-BUSYSTATUS:BUSY",
                "X-MICROSOFT-CDO-IMPORTANCE:2",
                "BEGIN:VALARM",
                "TRIGGER:-PT1440M",
                "ACTION:DISPLAY",
                "DESCRIPTION:Reminder",
                "END:VALARM",
                "END:VEVENT",
                "END:VCALENDAR"};

            System.IO.File.WriteAllLines(Server.MapPath("Sample2.ics"), content,System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample3.ics"), contents1, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample4.ics"), contents2, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample5.ics"), contents3, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample6.ics"), contents4, System.Text.Encoding.UTF8);
            System.IO.File.WriteAllLines(Server.MapPath("Sample7.ics"), contents5, System.Text.Encoding.UTF8);
            //METHOD TO SEND EMAIL IS CALLED
            SendMail();
            //Thread t1 = new System.Threading.Thread(new ThreadStart(SendMail));
            //t1.Start();
posted @ 2012-02-03 20:39 ®Geovin Du Dream Park™ 阅读(76) 评论(0) 编辑
  1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using System.Security;
10 using System.Reflection;
11 using System.Security.Permissions;
12
13 [assembly: AssemblyKeyFile("keys.snk")]
14 [assembly: AssemblyVersion("1.1.1.0")]
15 namespace FindDataTableDeme
16 {
17 [PublisherIdentityPermission(SecurityAction.InheritanceDemand,CertFile="Certificate.cer")]
18 public partial class Form1 : Form
19 {
20 DataSet ds = new DataSet();
21 private DataRow rowFound;
22 //System.Runtime.Serialization.ISerializable
23 //System.SerializableAttribute
24
25 /// <summary>
26 ///
27 /// </summary>
28 public Form1()
29 {
30 InitializeComponent();
31 }
32 /// <summary>
33 /// 塗聚文 締友計算機信息技術有限公司 Geovin Du
34 /// </summary>
35 /// <param name="sender"></param>
36 /// <param name="e"></param>
37 private void Form1_Load(object sender, EventArgs e)
38 {
39 //DataTable dt = findDatatble();
40 //DataRow foundRow =dt.DefaultView.Find(this.textBox1.Text.Trim());
41 findDatatble();
42 }
43
44 private void findDatatble()
45 {
46
47 DataTable table1 = new DataTable("table one");
48 DataTable table2 = new DataTable("table two");
49
50 //creating columns for the tables:
51 table1.Columns.Add(new DataColumn("id", typeof(int)));
52 table1.Columns.Add(new DataColumn("someText", typeof(string)));
53
54 table2.Columns.Add(new DataColumn("id2", typeof(int)));
55 table2.Columns.Add(new DataColumn("someOtherText", typeof(string)));
56
57 //populating tables, one by one and add them to dataSet:
58 //populating table 1:
59 DataRow dr;
60 for (int i = 1; i < 13; i++)
61 {
62 dr = table1.NewRow();
63 dr["id"] = i;
64 dr["someText"] = "text with number " + i.ToString();
65 table1.Rows.Add(dr);
66 }
67 dr = table1.NewRow();
68 dr["id"] = 14;
69 dr["someText"] = "涂聚文";
70 table1.Rows.Add(dr);
71 //populating table 2:
72 for (int i = 101; i < 113; i++)
73 {
74 dr = table2.NewRow();
75 dr["id2"] = i;
76 dr["someOtherText"] = "other text with number " + i.ToString();
77 table2.Rows.Add(dr);
78 }
79 dr = table2.NewRow();
80 dr["id2"] = 114;
81 dr["someOtherText"] = "涂聚文";
82 table2.Rows.Add(dr);
83 //adding both tables to dataSet:
84 ds.Tables.AddRange(new DataTable[] { table1, table2 });
85 //you could add them seperately, like:
86 //ds.Tables.Add(table1);
87 //ds.Tables.Add(table2);
88
89
90 //Now lets loop through the dataSet and write the results out (int messageBox):
91 for (int i = 0; i < ds.Tables.Count; i++) //LOOP THROUGH TABLES OF DATASET
92 {
93 string text = null;
94 foreach (DataRow dr1 in ds.Tables[i].Rows) //LOOP TRGOUGH THE ROWS OF <strong class="highlight">DATATABLE</strong>
95 {
96 string a = dr1[0].ToString();
97 string b = dr1[1].ToString();
98 text += a + ". " + b + Environment.NewLine;
99 }
100 // MessageBox.Show("In dataSet is dataTable of index [" + i + "] with values:\n" + text);
101 }
102 ds.Tables[0].DefaultView.Sort = "id";
103 // Set Primary Key and Sort Order
104 DataColumn[] dcolPk = new DataColumn[1];
105 dcolPk[0] = ds.Tables[0].Columns["someText"];
106 ds.Tables[0].PrimaryKey = dcolPk;
107
108 dataGridView1.DataSource = ds.Tables[0].DefaultView;
109
110 }
111 /// <summary>
112 ///
113 /// </summary>
114 /// <param name="sender"></param>
115 /// <param name="e"></param>
116 private void button1_Click(object sender, EventArgs e)
117 {
118 try
119 {
120 int intRow;
121 object s = textBox1.Text.Trim();
122 // At least one row matches primary key
123 rowFound = ds.Tables[0].Rows.Find(s); //所搜索的内容,也是设定的主键
124 if (rowFound != null)
125 {
126 MessageBox.Show(rowFound[0].ToString()+","+rowFound[1].ToString());
127 }
128 else
129 {
130 MessageBox.Show("A row with the primary key of " + s + " could not be found");
131 }
132 DataRow[] foundRows;
133 foundRows = ds.Tables[0].Select("someText Like '涂%'");
134 if (foundRows != null)
135 {
136 MessageBox.Show(foundRows[0].ToString());
137 }
138
139 //// Finds the row specified in txtFindArg
140 //intRow = ds.Tables[0].DefaultView.Find(s);
141 ////Debug.WriteLine(intRow);
142 //if (intRow == -1)
143 //{
144 // MessageBox.Show("No PK matches " + textBox1.Text);
145 //}
146 //else
147 //{
148 //// Jump to the Row and select it
149 ////dataGridView1.CurrentRow.Index = intRow; //CurrentRowIndex
150 // dataGridView1.Rows[intRow].Selected=true;
151 //}
152 }
153 catch (Exception ex)
154 {
155 MessageBox.Show(ex.ToString());
156 }
157
158 }
159
160 private void s()
161 {
162
163 //create a datatable object which will host the two column: notebookID, notebook producer
164 DataTable o_aTable = new DataTable("Notebooks");
165
166
167 //creating a datacolumn
168 //definition and initilization of column
169 DataColumn o_aColumn = new DataColumn();
170 //defining column properties
171 //caption
172 o_aColumn.Caption = "Notebook Producers";
173 //type of column
174 o_aColumn.DataType = System.Type.GetType("System.String");
175 //access name of column
176 o_aColumn.ColumnName = "Producer";
177 //default value
178 o_aColumn.DefaultValue = "unknown producer";
179
180 //add column to the table
181 o_aTable.Columns.Add(o_aColumn);
182
183 //initialize a new instance of data column for creating a new column
184 o_aColumn = new DataColumn();
185 //defining column properties
186 //caption
187 o_aColumn.Caption = "Notebook Producer ID";
188 //type of column
189 o_aColumn.DataType = System.Type.GetType("System.Int32");
190 //access name of column
191 o_aColumn.ColumnName = "ProducerID";
192 //default value
193 o_aColumn.DefaultValue = 0000;
194
195 //add new column to the table
196 o_aTable.Columns.Add(o_aColumn);
197
198 //create a primary key column to use search
199 //definition and initial.
200 DataColumn[] o_aPrimaryKeyColumn = new DataColumn[1];
201 //assigning notebookID column of created table to this column: it will serve as primary key column
202 o_aPrimaryKeyColumn[0] = o_aTable.Columns["ProducerID"];
203 //mapping primary key column of table to the created primary key holder column
204 o_aTable.PrimaryKey = o_aPrimaryKeyColumn;
205
206 //adding rows-records to column
207 //create a datarow object which serves as a record entry
208 DataRow o_aRow;
209
210 //adding the records
211 //add 1th record for producer HP
212 //initialize a new row for table object
213 o_aRow = o_aTable.NewRow();
214 //assign value of 1th column ID
215 o_aRow["ProducerID"] = 1;
216 //assign value of 2th column producer
217 o_aRow["Producer"] = "HP";
218 //add 1th row to the table
219 o_aTable.Rows.Add(o_aRow);
220
221 //add 2nd record for producer IBM
222 //initialize a new row for table object
223 o_aRow = o_aTable.NewRow();
224 //assign value of 1th column ID
225 o_aRow["ProducerID"] = 2;
226 //assign value of 2th column producer
227 o_aRow["Producer"] = "IBM";
228 //add 2nd row to the table
229 o_aTable.Rows.Add(o_aRow);
230
231 //display the records within table
232
233 for (int i = 0; i < o_aTable.Rows.Count;i++ )
234 {
235 //display ID
236 Console.WriteLine("row " + i + ": notebook ID is: " + o_aTable.Rows[i]["ProducerID"].ToString());
237 //display producer
238 Console.WriteLine("row " + i + ": notebook Producer is: " + o_aTable.Rows[i]["Producer"].ToString());
239
240 }
241 //Handling row with specifying a particular primary column addressed by ID
242 //create a row object to store found row which matches criteria ID
243 DataRow o_dRow_findedRow;
244 //look for row with id 1
245 if ((o_dRow_findedRow = o_aTable.Rows.Find("1")) != null)
246 {
247
248 Console.WriteLine("Primary key column of Table (in memory) is being queried for notebookID 1...");
249 Console.WriteLine("A row with notebookID 1 is found.");
250 }
251 else
252 {
253 Console.WriteLine("A record with notebookID 1 is not found.");
254 }
255
256 }
257
258
259 }
260 }

 

posted @ 2012-01-14 15:40 ®Geovin Du Dream Park™ 阅读(85) 评论(0) 编辑
摘要: Calculate distance, bearing and more between Latitude/Longitude pointshttp://www.movable-type.co.uk/scripts/latlong.htmlThis page presents a variety of calculations for latitude/longitude points, with the formul? and code fragments for implementing them.All these formul? are for calculations on the 阅读全文
posted @ 2012-01-12 12:39 ®Geovin Du Dream Park™ 阅读(34) 评论(0) 编辑
dim Info,SystemName,BrowserName,ipdress
 Info=Request.ServerVariables("Http_User_Agent")

'涂聚文 2009/09/30 缔友计算机信息技术有限公司 捷为工作室 =其次:用Request.ServerVariables("Http_User_Agent")=
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 598; .NET CLR 2.0.50727; CIBA; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; InfoPath.2)
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009080717 Firefox/3.0.13
 'Opera/9.80 (Windows NT 5.1; U; zh-cn) Presto/2.2.15 Version/10.01
 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 QQDownload/1.7
'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 QQDownload/1.7
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0
'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9.1
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080219 Firefox/2.0.0.12 Navigator/9.0.0.6
Function Browser(Info)
Info=Request.ServerVariables("Http_User_Agent") '在这里初始化了Info,在实际应用中可以作为其他变量赋值
'Response.Write Info & "<p>"
If InStr(Info,"MSIE 9")>0 Then
Browser="Internet Explorer 9"
If InStr(Info,"MSIE 8")>0 Then
Browser="Internet Explorer 8"
ElseIf InStr(Info,"MSIE 7")>0 Then
Browser="Internet Explorer 7"
ElseIf InStr(Info,"MSIE 6")>0 Then
Browser="Internet Explorer 6"
ElseIf InStr(Info,"MSIE 5.5")>0 Then
Browser="Internet Explorer 5.5"
ElseIf InStr(Info,"MSIE 5.0")>0 Then
Browser="Internet Explorer 5.0"
ElseIf InStr(Info,"MSIE 4")>0 Then
Browser="Internet Explorer 4.0"
ElseIf InStr(Info,"Opera")>0 Then
Browser="Opera"
ElseIf InStr(Info,"Firefox")>0 and InStr(Info,"Chrome/3")=0 and InStr(Info,"Safari/5")=0 and InStr(Info,"Navigator")=0 Then
Browser="Firefox"
ElseIf InStr(Info,"Chrome")>0 and InStr(Info,"Safari")>0 Then
Browser="Chrome"
ElseIf InStr(Info,"Safari")>0 Then
Browser="Safari"
'Navigator
ElseIf InStr(Info,"Navigator")>0 and InStr(Info,"Firefox")>0 Then
Browser="Navigator"
Else
Browser="未知的浏览器"
End if
'Response.Write "'涂聚文 2009/09/30 缔友计算机信息技术有限公司 捷为工作室您的浏览器是:"&Browser&"<p>"
BrowserName=Browser
End Function

Function System(Info)
Info=Request.ServerVariables("Http_User_Agent")
If InStr(Info,"Windows NT 6.1")>0 Then
System="Windows7/2008R2"
ElseIf InStr(Info,"Windows NT 6.0")>0 Then
System="Vista/2008"
ElseIf InStr(Info,"Windows NT 5.2")>0 Then
System="Windows 2003"
ElseIf InStr(Info,"Windows NT 5.1")>0 Then
System="Windows XP"
ElseIf InStr(Info,"Windows NT 5.0")>0 Then
System="Windows 2000"
ElseIf InStr(Info,"Windows NT 4")>0 Then
System="Windows NT"
ElseIf InStr(Info,"98")>0 Then
System="Windows 98"
ElseIf InStr(Info,"Me")>0 Then
System="Windows Me"
ElseIf InStr(Info,"95")>0 Then
System="Windows 95"
ElseIf InStr(Info,"Mac")>0 Then
System="Mac"
ElseIf InStr(Info,"Unix")>0 Then
System="Unix"
ElseIf InStr(Info,"Linux")>0 Then
System="Linux"
ElseIf InStr(Info,"SunOS")>0 Then
System="SunOS"
Else
System="未知的操作系统"
End if
'Response.Write "您的操作系统是:"&System&"<p>"
 SystemName=System
End Function

BrowserName= Browser(Info)
SystemName= System(Info)
ipdress=Request.ServerVariables("REMOTE_ADDR")

 

posted @ 2012-01-12 10:51 ®Geovin Du Dream Park™ 阅读(26) 评论(0) 编辑

xml file:

<?xml version="1.0" encoding="utf-8"?>
<Root>
  <UserInfo>
    <Login Name="geovindu">
      <Pass>l17pi6MYm2g=</Pass>
    </Login>
    <Login Name="涂聚文祝你龙年大悦http://www.dusystem.com/Happynewyear.html">
      <Pass>4IGT6o/qA4vKYzlgizWsDg==</Pass>
    </Login>
    <Login Name="涂聚文">
      <Pass>ULNR7dw9V7M=</Pass>
    </Login>
  </UserInfo>
</Root>

 

            int ws = 0;

            int pi = 0;

            int dc = 0;

            int cc = 0;

            int ac = 0;

            int et = 0;

            int el = 0;

            int xd = 0;
            XmlDocument xmlConditions = new XmlDocument();
            
            string url = Server.MapPath("User.xml");
            XmlTextReader textReader = new XmlTextReader(url);
            //textReader.WhitespaceHandling = WhitespaceHandling.None;
            //xmlConditions.Load(textReader);
            //XmlNode xnodDE = xmlConditions.DocumentElement;

            //Response.Write(xnodDE.ChildNodes[0].ToString());

           // string t=ChildDisplay(xnodDE, 0);
            //Response.Write(t);
            //textReader.Close();
            string sName = "";
            while (textReader.Read())
            {
                XmlNodeType nType = textReader.NodeType;

                // If node type us a declaration

                if (nType == XmlNodeType.XmlDeclaration)
                {

                    Response.Write("Declaration:" + textReader.Name.ToString() + "<br/>");

                    xd = xd + 1;

                }

                // if node type is a comment

                if (nType == XmlNodeType.Comment)
                {

                    Response.Write("Comment:" + textReader.Name.ToString() + "<br/>");

                    cc = cc + 1;

                }

                // if node type us an attribute

                if (nType == XmlNodeType.Attribute)
                {

                    Response.Write("Attribute:" + textReader.Name.ToString() + "<br/");

                    ac = ac + 1;

                }

                // if node type is an element

                if (nType == XmlNodeType.Element)
                {

                    Response.Write("Element:" + textReader.Name.ToString() + "<br/>");

                    el = el + 1;

                }



                // if node type is an entity\

                if (nType == XmlNodeType.Entity)
                {

                    Response.Write("Entity:" + textReader.Name.ToString() + "<br/>");

                    et = et + 1;

                }

                // if node type is a Process Instruction

                if (nType == XmlNodeType.Entity)
                {

                    Response.Write("Entity:" + textReader.Name.ToString() + "<br/>");

                    pi = pi + 1;

                }

                // if node type a document

                if (nType == XmlNodeType.DocumentType)
                {

                    Response.Write("Document:" + textReader.Name.ToString() + "<br/>");

                    dc = dc + 1;

                }

                // if node type is white space

                if (nType == XmlNodeType.Whitespace)
                {

                    Response.Write("WhiteSpace:" + textReader.Name.ToString() + "<br/>");
                    //Response.Write("name:" + xmlConditions.Attributes["Name"].ToString());
                    //Response.Write("login:" + xmlConditions.GetElementsByTagName("Login").ToString());
                    ws = ws + 1;

                }


                switch (textReader.NodeType)
                {

                    case XmlNodeType.Element:
                        sName = textReader.Name;
                        Response.Write("读取:Element:" + sName + "<br/>");
                        if (textReader.HasAttributes)
                        {
                            for (int i = 0; i <= textReader.AttributeCount - 1; i++)
                                Response.Write("屬性: " + textReader.GetAttribute(i) + " <br/>");
                            Response.Write("屬性Name: " + textReader.GetAttribute("Name") + " <br/>");
                        }
                        if (sName == "Login")
                        {
                            Response.Write("IF屬性Name: " + textReader.GetAttribute("Name") + " <br/>");
                        }
                        break;
                    case XmlNodeType.Text:
                        switch (sName)
                        {
                            case "Login":
                                Response.Write("Login:"+textReader.Value+"<br/>");
                                if (textReader.HasAttributes)
                                {
                                    for (int i = 0; i <= textReader.AttributeCount - 1; i++)
                                        Response.Write("屬性: " + textReader.GetAttribute(i) + " <br/>");
                                }
                                break;
                            case "Pass":
                                Response.Write("Pass:" + textReader.Value + "<br/>");
                                break;
                            case "UserInfo":
                                Response.Write("UserInfo:" + textReader.Value + "<br/>");
                                break;
                        }
                        break;
                }
               


            }

            Response.Write("Total Comments:" + cc.ToString());

            Response.Write("Total Attributes:" + ac.ToString());

            Response.Write("Total Elements:" + el.ToString());

            Response.Write("Total Entity:" + et.ToString());

            Response.Write("Total Process Instructions:" + pi.ToString());

            Response.Write("Total Declaration:" + xd.ToString());

            Response.Write("Total DocumentType:" + dc.ToString());

            Response.Write("Total WhiteSpaces:" + ws.ToString());

 

posted @ 2012-01-11 20:22 ®Geovin Du Dream Park™ 阅读(102) 评论(0) 编辑
---2005附加數據庫
---ATTACH DATABASE TEMPLATE
---涂聚文 2012 元旦
exec sp_attach_db 'Asset5','D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Asset5.mdf','D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Asset5_log.ldf'
GO
---列出存儲過程
exec sp_stored_procedures
GO
--系統視圖
select * from sys.objects

---列出存儲過程
select * from sys.objects WHERE TYPE='P'
select [name] from sysobjects where xtype='P' order by [name]
GO
---列出所有表
select * from sys.objects WHERE TYPE='U' order by [name]
select [name] from sysobjects where xtype='U' order by [name]

GO
--列出視圖
select * from sys.objects WHERE TYPE='V' order by [name]
select [name] from sysobjects where xtype='V' order by [name]

GO
--
select * from sysobjects
GO

--列出所有表
select [name] from sysobjects where xtype='u' order by [name]
GO

--查詢數據庫中的表所占用空間
exec sp_spaceused '表名' --取得表占用空間  
exec sp_spaceused ''--數據庫所有空間  

---1 種方式
create table #Data(name varchar(100),row varchar(100),reserved varchar(100),data varchar(100),index_size varchar(100),unused varchar(100))
GO
declare @name varchar(100)
declare cur cursor  for
    select name from sysobjects where xtype='u' order by name
open cur
fetch next from cur into @name
while @@fetch_status=0
begin
    insert into #data
    exec sp_spaceused   @name
    print @name

    fetch next from cur into @name
end
close cur
deallocate cur
go
select * from #Data
GO
---2 種方式
create table #DataNew(name varchar(100),row int,reserved int,data int,index_size int,unused int)
GO
insert into #dataNew
select name,convert(int,row) as row,convert(int,replace(reserved,'KB','')) as reserved,convert(int,replace(data,'KB','')) as data,
convert(int,replace(index_size,'KB','')) as index_size,convert(int,replace(unused,'KB','')) as unused from #data
GO
select * from #dataNew order by data desc
GO
---數據庫對象限定符:
--[[[server.][database].][schema].]database_object
---schema dbo(默認模式)

/*

使用完毕后,记得一定要要关闭它,因为这是一个安全隐患,切记执行下面的SQL语句

--创建链接服务器
exec sp_addlinkedserver   'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 '
exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, '用户名 ', '密码 '

--查询示例
select * from ITSV.数据库名.dbo.表名

--导入示例
select * into 表 from ITSV.数据库名.dbo.表名

--以后不再使用时删除链接服务器
exec sp_dropserver  'ITSV ', 'droplogins '

--连接远程/局域网数据(openrowset/openquery/opendatasource)
--1、openrowset

--查询示例
select * from openrowset( 'SQLOLEDB ', 'sql服务器名 '; '用户名 '; '密码 ',数据库名.dbo.表名)

--生成本地表
select * into 表 from openrowset( 'SQLOLEDB ', 'sql服务器名 '; '用户名 '; '密码 ',数据库名.dbo.表名)

--把本地表导入远程表
insert openrowset( 'SQLOLEDB ', 'sql服务器名 '; '用户名 '; '密码 ',数据库名.dbo.表名)
select *from 本地表

--更新本地表
update b
set b.列A=a.列A
from openrowset( 'SQLOLEDB ', 'sql服务器名 '; '用户名 '; '密码 ',数据库名.dbo.表名)as a inner join 本地表 b
on a.column1=b.column1

--openquery用法需要创建一个连接

--首先创建一个连接创建链接服务器
exec sp_addlinkedserver   'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 '
--查询
select *
FROM openquery(ITSV,  'SELECT *  FROM 数据库.dbo.表名 ')
--把本地表导入远程表
insert openquery(ITSV,  'SELECT *  FROM 数据库.dbo.表名 ')
select * from 本地表
--更新本地表
update b
set b.列B=a.列B
FROM openquery(ITSV,  'SELECT * FROM 数据库.dbo.表名 ') as a  
inner join 本地表 b on a.列A=b.列A

--3、opendatasource/openrowset
SELECT   *
FROM   opendatasource( 'SQLOLEDB ',  'Data Source=ip/ServerName;User ID=登陆名;Password=密码 ' ).test.dbo.roy_ta
--把本地表导入远程表
insert opendatasource( 'SQLOLEDB ',  'Data Source=ip/ServerName;User ID=登陆名;Password=密码 ').数据库.dbo.表名
select * from 本地表

*/


--2005 启用Ad Hoc Distributed Queries的方法,执行下面的查询语句就可以了:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
--使用完毕后,记得一定要要关闭它,因为这是一个安全隐患,切记执行下面的SQL语句
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure  

--2005
SELECT top 10 * FROM OPENDATASOURCE('SQLOLEDB','Data Source=.;User ID=sa;Password=geovindu;').geovinduDB.dbo.meetingApply
GO

--openrowset使用OLEDB的一些例子
select * from openrowset('SQLOLEDB','Server=(local);PWD=***;UID=sa;','select * from GEOVINDU.dbo.school') as t
select * from openrowset('SQLOLEDB','Server=(local);PWD=***;UID=sa;',GEOVINDU.dbo.school) as t
select * from openrowset('SQLOLEDB','Server=(local);Trusted_Connection=yes;',GEOVINDU.dbo.school) as t
select * from openrowset('SQLOLEDB','(local)';'sa';'***','select * from GEOVINDU.dbo.school') as t
select * from openrowset('SQLOLEDB','(local)';'sa';'***',GEOVINDU.dbo.school) as t
select * from openrowset('SQLOLEDB','(local)';'sa';'***','select school.id as id1,people.id as id2 from GEOVINDU.dbo.school inner join GEOVINDU.dbo.people on school.id=people.id') as t

--openrowset使用SQLNCLI的一些例子(SQLNCLI在SqlServer2005以上才能使用)
select * from openrowset('SQLNCLI','(local)';'sa';'***','select * from GEOVINDU.dbo.school') as t
select * from openrowset('SQLNCLI','Server=(local);Trusted_Connection=yes;','select * from GEOVINDU.dbo.school') as t
select * from openrowset('SQLNCLI','Server=(local);UID=sa;PWD=***;','select * from GEOVINDU.dbo.school') as t
select * from openrowset('SQLNCLI','Server=(local);UID=sa;PWD=***;',GEOVINDU.dbo.school) as t
select * from openrowset('SQLNCLI','Server=(local);UID=sa;PWD=***;DataBase=GEOVINDU','select * from dbo.school') as t

--openrowset其他使用
insert openrowset('SQLNCLI','Server=(local);Trusted_Connection=yes;','select name from GEOVINDU.dbo.school where id=1') values('geovindu')/*要不要where都一样,插入一行*/
update openrowset('SQLNCLI','Server=(local);Trusted_Connection=yes;','select name from GEOVINDU.dbo.school where id=1') set name='geovindu'
delete from openrowset('SQLNCLI','Server=(local);Trusted_Connection=yes;','select name from GEOVINDU.dbo.school where id=1')





--opendatasource使用SQLNCLI的一些例子
select * from opendatasource('SQLNCLI','Server=(local);UID=sa;PWD=***;').GEOVINDU.dbo.school as t
select * from opendatasource('SQLNCLI','Server=(local);UID=sa;PWD=***;DataBase=TB').GEOVINDU.dbo.school as t

--opendatasource使用OLEDB的例子
select * from opendatasource('SQLOLEDB','Server=(local);Trusted_Connection=yes;').GEOVINDU.dbo.school as t

--opendatasource其他使用
insert opendatasource('SQLNCLI','Server=(local);Trusted_Connection=yes;').GEOVINDU.dbo.school(name) values('geovindu')/*要不要where都一样,插入一行*/
update opendatasource('SQLNCLI','Server=(local);Trusted_Connection=yes;').GEOVINDU.dbo.school set name='geovindu'
delete from opendatasource('SQLNCLI','Server=(local);Trusted_Connection=yes;').GEOVINDU.dbo.school where id=1





--openquery使用OLEDB的一些例子
exec sp_addlinkedserver   'ITSV', '', 'SQLOLEDB','(local)'
exec sp_addlinkedsrvlogin 'ITSV', 'false',null, 'sa', '***'
select * FROM openquery(ITSV,  'SELECT *  FROM GEOVINDU.dbo.school ')

--openquery使用SQLNCLI的一些例子
exec sp_addlinkedserver   'ITSVA', '', 'SQLNCLI','(local)'
exec sp_addlinkedsrvlogin 'ITSVA', 'false',null, 'sa', '***'
select * FROM openquery(ITSVA,  'SELECT *  FROM GEOVINDU.dbo.school ')

--openquery其他使用
insert openquery(ITSVA,'select name from GEOVINDU.dbo.school where id=1') values('geovindu')/*要不要where都一样,插入一行*/
update openquery(ITSVA,'select name from GEOVINDU.dbo.school where id=1') set name='geovindu'
delete openquery(ITSVA,'select name from GEOVINDU.dbo.school where id=1')


backup database intranet to disk='C:\ba.bak' with init


RESTORE DATABASE nwind_new FROM DISK = 'c:\backups\northwind\nwind.bak'
WITH
MOVE 'northwind' TO 'd:\Program Files\Microsoft SQL
Server\Data\nwind_new.mdf'
MOVE 'northwind_log' TO 'd:\Program Files\Microsoft SQL
Server\Data\nwind_new_log.ldf'
SELECT *
FROM OPENDATASOURCE(
    'Microsoft.Jet.OLEDB.4.0',
    'Data Source=C:\test.xls;Extended Properties=EXCEL 5.0'
)...[Sheet1$];

SELECT * FROM
OpenDataSource(
    'Microsoft.Jet.OLEDB.4.0',
    'Data Source="c:\temp\payroll.mdb";
    User ID=Admin;Password=;')...employees


SELECT  *
FROM OPENROWSET
        ( BULK 'C:\data.txt',SINGLE_CLOB)
AS a

 

posted @ 2012-01-05 14:55 ®Geovin Du Dream Park™ 阅读(89) 评论(0) 编辑
摘要: <!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><meta content="text/html; charset=utf-8" http-equiv="Content-Typ阅读全文
posted @ 2011-12-18 18:09 ®Geovin Du Dream Park™ 阅读(81) 评论(0) 编辑
摘要: <!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><meta content="text/html; charset=utf-8" http-equiv="Content-Typ阅读全文
posted @ 2011-12-17 15:23 ®Geovin Du Dream Park™ 阅读(46) 评论(1) 编辑
摘要: css code:/* 2011-11-28 塗聚文 締友計算機信息技術有限公司 CSS DIV Shadow css3 */#geovinduDiv-shadow{ padding:10px; background-color:#f9f9f9; border:1px solid #fff; position:relative; /*Firefox*/ -moz-box-shadow: 3px 3px 4px #000; /*Safari,Chrome*/ -webkit-box-shadow: 3px 3px 4px #000; /*css3: Opera,IE9*/...阅读全文
posted @ 2011-11-30 16:36 ®Geovin Du Dream Park™ 阅读(101) 评论(0) 编辑
摘要: 文本文件中的內容格式為:(其中問題,誰能否解決大於15M的文本文件能快速讀到DataTable中)俚 rustic俚语 slang哩 mile哩 onomat哩数 milage逦 winding理 logic理 reason理 science理八郎 Rihachiro理兵卫 Rihee理兵卫 Rihei理财 financing理财 portfolio理查 Richard理查德 Richard理查德冰川 Richardsbreen理查顿 Richardton理查多 Richardo理查多维奇 Richardovich理查姆斯 Richarms理查森 Richardson理查特 Richart理查阅读全文
posted @ 2011-11-24 21:12 ®Geovin Du Dream Park™ 阅读(165) 评论(0) 编辑

公告

我痴痴的等,幽幽的怨,望穿了秋水,辗转了缠绵,想坏了脾胃,思伤了心肝,累坏了腿情。总想深情的问:何时共诉情愫时?
昵称:®Geovin Du Dream Park™
园龄:6年3个月
粉丝:7
关注:0
<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

搜索

 

相册

<a herf="http://www.geovi.com">捷为工作室</a>

积分与排名

  • 积分 - 45880
  • 排名 - 2305

最新评论

阅读排行榜

评论排行榜

推荐排行榜