Đọc file Excel:
Dim xlApp As Excel.Application = Nothing
Dim xlWorkBooks As Excel.Workbooks = Nothing
Dim xlWorkBook As Excel.Workbook = Nothing
Dim xlWorkSheet As Excel.Worksheet = Nothing
Dim xlWorkSheets As Excel.Sheets = Nothing
Dim xlCells As Excel.Range = Nothing
Dim xlRange As Excel.Range = Nothing
xlApp = New Excel.Application
Dim List As New List(Of List(Of Object))
Phạm Thái Hòa
Trang blog cá nhân
Tạo hộp thoại chọn và đọc file *.txt bằng VB.Net
Chuyên mục:
AutoCAD.Net,
Tệp và Thư mục
Imports System.IO
Private Sub bt_Open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Open.Click
Dim Open_File As String
Dim OpenFileDialog1 As New OpenFileDialog()
OpenFileDialog1.Filter = "Text File (*.txt)|*.txt"
OpenFileDialog1.Title = "Chọn file *.txt để mở"
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName <> "" Then
Open_File = OpenFileDialog1.FileName
Dim AllText() As String = File.ReadAllLines(Add)
For Each Line In AllText
''
Next
End If
End Sub
Private Sub bt_Open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Open.Click
Dim Open_File As String
Dim OpenFileDialog1 As New OpenFileDialog()
OpenFileDialog1.Filter = "Text File (*.txt)|*.txt"
OpenFileDialog1.Title = "Chọn file *.txt để mở"
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName <> "" Then
Open_File = OpenFileDialog1.FileName
Dim AllText() As String = File.ReadAllLines(Add)
For Each Line In AllText
''
Next
End If
End Sub
Lấy đường dẫn thư mục chương trình bằng VB.Net
Chuyên mục:
AutoCAD.Net,
Tệp và Thư mục
Function App_Path() As String
Dim AppPath As String = System.Reflection.Assembly.GetExecutingAssembly.Location()
Dim NameAssembly As String = System.Reflection.Assembly.GetExecutingAssembly.GetName.Name
AppPath = Left(AppPath, AppPath.Length - NameAssembly.Length - 4)
Return AppPath
End Function
Dim AppPath As String = System.Reflection.Assembly.GetExecutingAssembly.Location()
Dim NameAssembly As String = System.Reflection.Assembly.GetExecutingAssembly.GetName.Name
AppPath = Left(AppPath, AppPath.Length - NameAssembly.Length - 4)
Return AppPath
End Function
Những câu trả lời làm người đối diện cứng họng
Chuyên mục:
Giải Trí,
Truyện Cười
1. Tiệc tùng với đồng nghiệp về nhà muộn, vợ không cho vào phòng bắt ngủ sofa. Tôi điên tiết quát:" Nhà tôi tôi thích ngủ đâu thì ngủ. Ko ngủ sofa đấy, ngủ đất thì đã làm sao!"
2. -"Sao anh lại chen ngang bất lịch sự thế?"
-"Vì tôi là người vô văn hoá."
3. -"Sao ngồi ăn cơm một mình thế kia?"
-"Chứ nửa mình thì ăn kiểu gì?"
4. -"Cậu có ý đồ gì thế?"
-"Cậu đoán xem."
-"Mình đoán ra rồi."
-"Là gì?"
-"Cậu đoán xem."
2. -"Sao anh lại chen ngang bất lịch sự thế?"
-"Vì tôi là người vô văn hoá."
3. -"Sao ngồi ăn cơm một mình thế kia?"
-"Chứ nửa mình thì ăn kiểu gì?"
4. -"Cậu có ý đồ gì thế?"
-"Cậu đoán xem."
-"Mình đoán ra rồi."
-"Là gì?"
-"Cậu đoán xem."