标题:有关vb.net 调用dll
只看楼主
shunlai
Rank: 1
等 级:新手上路
威 望:1
帖 子:228
专家分:0
注 册:2006-2-1
结帖率:94.12%
 问题点数:0 回复次数:1 
有关vb.net 调用dll
Imports
Public Class TXTClass1
    Private SW As StreamWriter
      Public Sub New()

    End Sub
    '写入追加的形式写入一行
    Public Sub ZhuiJiaSingle(ByVal Parth As String, ByVal strline As String)
        SW = New StreamWriter(Parth, True, System.Text.Encoding.Default)
        SW.WriteLine(strline)
        SW.Flush()
        SW.Close()
        SW = Nothing
    End Sub
以上是dll内容,以下是调用总报错!请高手指教。谢谢!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
      Dim bool As Boolean = False
        bool = ZhuiJiaSingle(Application.StartupPath & "\Wenben1.txt", TextBox1.Text)

        If bool Then
            MessageBox.Show("数据已写入")
        Else
            MessageBox.Show("写入数据时出错")
        End If
    End Sub
搜索更多相关主题的帖子: System Sub End 写入 ByVal 
2018-08-24 16:42
shunlai
Rank: 1
等 级:新手上路
威 望:1
帖 子:228
专家分:0
注 册:2006-2-1
得分:0 
问题已解决,谢谢大家!
2018-09-02 09:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-489405-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.294444 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved