目前我对某些文件使用动态路径。
Public Sub connect()
Try
Dim server_ipendpoint As New IPEndPoint(IPAddress.Parse(m_ip_host), m_port_host)
tcpLsn = New TcpListener(server_ipendpoint)
tcpLsn.Start()
tcpThd = New Thread(AddressOf waiting_client)
tcpThd.Start()
Form1.MainInstance.TextBox1.Text = "Listening" & vbCrLf
Catch ex As Exception
is_exception = True
End Try
End Sub
Private Sub waiting_client()
Form1.MainInstance.SetText(Form1.MainInstance.TextBox1, "helllllooooooooo")
End Sub
但是如果这个文件不存在怎么办? let targetFile = require(`../files/${name}.js`);
targetFile.run();
会抛出错误。我将代码更改为
require
但现在代码总是遇到“未找到”。我是否必须设置绝对路径?