Code
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