在所有kill執(zhí)行完畢以后輸出一個(gè)批處理文件,用途是刪除卸載程序,在退出時(shí)調(diào)用它。
創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供利州網(wǎng)站建設(shè)、利州做網(wǎng)站、利州網(wǎng)站設(shè)計(jì)、利州網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、利州企業(yè)網(wǎng)站模板建站服務(wù),10多年利州做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
Private Sub Command1_Click()
Open App.Path + "\1.bat" For Binary As #1
Put #1, , "del " + App.EXEName + ".exe" vbCrLf
Put #1, , "del 1.bat"
Close #1
End Sub
Private Sub Form_Unload(Cancel As Integer)
Shell App.Path + "\1.bat"
End Sub
由于你要求的是能夠動(dòng)態(tài)的加載與卸載,所以這里選用了appdomain的load方法來加載一個(gè)程序集(同樣的,卸載的時(shí)候調(diào)用appdomain的靜態(tài)方法Unload即可).
另外由于,在appdomain.load的時(shí)候remoting會(huì)試圖將程序集序列化到defaultdomain中去,這會(huì)產(chǎn)生問題,通常以一個(gè)"FileNotFoundException"結(jié)束,因此采用了一種折中的辦法.
思路如下:
1.建立一個(gè)新的程序集,里面包含一個(gè)輕量的類型,這個(gè)類型只包含一個(gè)用來加載程序集的公共方法;
2.在你的主程序里面,用appdomain.load來加載上一步的程序集,接著實(shí)例化上一步的輕量的類型;
3.而后就可以像操作通常的對(duì)象一樣,調(diào)用它上面的方法來加載你想要的程序集了;
源代碼已經(jīng)打包發(fā)給你了,
你看看吧~
如果有問題,再找我哈
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
binddata()
End If
End Sub
Public Sub binddata()
'
End Sub
'編輯中
Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
GridView1.EditIndex = e.NewEditIndex
'當(dāng)前編輯行背景色高亮
GridView1.EditRowStyle.BackColor = Color.FromName("#F7CE90")
binddata()
End Sub
'分頁
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
binddata() '重新綁定GridView數(shù)據(jù)的函數(shù)
End Sub
'更新
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
Dim clsB As New sqlDLTP.business
Dim sqlstr As String
Dim ds As New DataSet
sqlstr = "select hbdwno from etsshbd where hbdcnm='" CType(GridView1.Rows(e.RowIndex).FindControl("TextBox1"), TextBox).Text.ToString().Trim() "'"
ds = clsB.queryitems(sqlstr)
Dim wno As String = ds.Tables(0).Rows(0)(0).ToString().Trim()
sqlstr = "update etsdl set okscore1='" _
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox6"), TextBox).Text.ToString().Trim() "',okscore2='" _
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox7"), TextBox).Text.ToString().Trim() "',okscore='" _
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox8"), TextBox).Text.ToString().Trim() "',okreport='" _
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox9"), TextBox).Text.ToString().Trim() "',okgrad='" _
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox10"), TextBox).Text.ToString().Trim() "',memo='" _
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox12"), TextBox).Text.ToString().Trim() "' where trano='" _
GridView1.DataKeys(e.RowIndex).Value.ToString() "' and wno='" wno "'"
clsB.ExeSqlCmd(sqlstr)
GridView1.EditIndex = -1
binddata()
End Sub
'取消
Protected Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit
GridView1.EditIndex = -1
binddata()
End Sub
'刪除
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
Dim clsB As New sqlDLTP.business
Dim sqlstr As String
Dim ds As New DataSet
sqlstr = "select hbdwno from etsshbd where hbdcnm='" CType(GridView1.Rows(e.RowIndex).FindControl("Label1"), Label).Text.ToString().Trim() "'"
ds = clsB.queryitems(sqlstr)
Dim wno As String = ds.Tables(0).Rows(0)(0).ToString().Trim()
sqlstr = "delete etsdl where trano=" GridView1.DataKeys(e.RowIndex).Value.ToString().Trim() "and wno='" wno "'"
clsB.ExeSqlCmd(sqlstr)
binddata()
End Sub
'綁定行,特效及鏈接列屬性分配等
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'鼠標(biāo)經(jīng)過時(shí),行背景色變
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E6F5FA'")
'鼠標(biāo)移出時(shí),行背景色變
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'")
' HyperLink列給鏈接值
CType(e.Row.Cells(1).FindControl("HyperLink1"), HyperLink).NavigateUrl = "javascript:void window.open('trashow.aspx?tno=" + CType(e.Row.Cells(1).FindControl("HyperLink1"), HyperLink).Text + "','', 'left='+(window.top.screen.width-454)/2+',top='+(window.top.screen.height-454)/2+',width=625,height=500,scrollbars=yes,resizeable=yes');"
'當(dāng)有編輯列時(shí),避免出錯(cuò),要加的RowState判斷
If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then
If CType(e.Row.Cells(12).FindControl("Label11"), Label).Text = "1" Then
CType(e.Row.Cells(12).FindControl("Label11"), Label).Text = "在職"
End If
End If
End If
End Sub
前臺(tái):
asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width=100% BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" AllowPaging="True" AllowSorting="True"
!-- --
/asp:GridView
VB.net 加載窗體 form2.show() 卸載窗體 me.close()加載窗體和VB沒啥區(qū)別,而卸載就截然不同了。附:VB 加載窗體 form2.show 卸載窗體 unload me
vb.net會(huì)在系統(tǒng)里.net,要想手工刪除幾乎是不可能的,建議你還是原有的反安裝程序來卸載。
新聞名稱:vb.net編寫卸載程序,vb怎么徹底卸載
分享網(wǎng)址:http://aaarwkj.com/article30/dsiihpo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、微信小程序、ChatGPT、服務(wù)器托管、定制網(wǎng)站、面包屑導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)