数据,POST,写XML,大数据的新增


string []s=new string[]{"1","2"}
var i=s.select(str=>Int.Prase(str)).toarray();
int[] lowerBounds={1};
int[] lengths={100};
int[] array=(int[])Array.CreateInstance(typeof(int),lengths,lowerBounds);
创建了长度100,下标从1开始的数组!
在A页面设置比如Botton,ImageBotton,LinkBotton的 PostBackUrl属性为 B.aspx,这样的方式也可以取出A页面的信息
if(PreviousPage.IsCrossPagePostBack == true) {
string info= ((TextBox)this.PreviousPage.FindControl("控件的ID,比如一个TextBox")).Text;
}
或者可以是
string info=Reques.Form["TextBox1"].ToString();
这种的写XML 可以减少线程冲突。。
String XmlFilePath = Server.MapPath("~/info/consultative.xml");
FileStream fs = new FileStream(XmlFilePath, FileMode.Open, FileAccess.ReadWrite);
XmlDocument doc1 = new XmlDocument();
doc1.Load(fs);
fs.Close();
XmlNodeList nodeList = doc.SelectNodes("consultative/info");
foreach (XmlNode node in nodeList)
{
foreach (XmlNode nodeChild in node.ChildNodes)
{
if (nodeChild.Name == "uuid" && nodeChild.InnerText != ViewState["uuid"].ToString())
break;
if (nodeChild.Name == "answer")
nodeChild.InnerText = FCKeditor1.Value;
if (nodeChild.Name == "question")
nodeChild.InnerText = FCKeditor2.Value;
}
}
fs = new FileStream(XmlFilePath, FileMode.Open, FileAccess.ReadWrite);
doc.Save(fs);
fs.Close();
void Application_Start(object sender, EventArgs e)
{
System.Threading.Thread fThread = new System.Threading.Thread(new System.Threading.ThreadStart(DoSth));
fThread.Start();
}
private void DoSth()
{
while (true)
{
try
{
// 你要处理期限的代码
}
catch
{
//
}
System.Threading.Thread.Sleep(600000); // <- 一小时执行一次
}
}
在WAP项目中。如果一个页面用wap2.0
<configuration>
<location path="Person/NewPhoto.aspx" >
<system.web>
<browserCaps>
<result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<use var="HTTP_USER_AGENT"/>
preferredRenderingType = "xhtml-mp"
</browserCaps>
</system.web>
</location>
</configuration>
这里是大数据的新增
1 Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
2 Dim t As New System.Data.DataTable
3 Dim c As System.Data.DataColumn
4 Dim sw As New System.Diagnostics.Stopwatch
5 sw.Start()
6 Dim conn As New System.Data.SqlClient.SqlConnection("Data Source=JXBW-YESHUNQUAN\SQLEXPRESS;Initial Catalog=test;Integrated Security=True")
7 conn.Open()
8 c = New System.Data.DataColumn("id")
9 t.Columns.Add(c)
10 c = New System.Data.DataColumn("name")
11 t.Columns.Add(c)
12 c = New System.Data.DataColumn("sex")
13 t.Columns.Add(c)
14 c = New System.Data.DataColumn("remark")
15 t.Columns.Add(c)
16 Dim bc As New System.Data.SqlClient.SqlBulkCopy(conn)
17 bc.DestinationTableName = "tbl1"
18 Dim i As Long
19 For i = 1 To 100000
20 t.Rows.Add(i, "gsdgfsdfg" & i, "男", "adfasdfasdddsssssssssssssssss我爱中国")
21 If i Mod 100 = 0 Then
22 bc.WriteToServer(t, DataRowState.Added)
23 t.Rows.Clear()
24 End If
25 Next i
26 conn.Close()
27 sw.Stop()
28 Debug.Print(sw.ElapsedMilliseconds / 1000 & "秒")
29 End Sub