FindFirstFile 1.go: The system cannot find the file specified golang调试错误

相信不少初学者会碰到跟我一样的问题,如下图所框

(我电脑系统win7 64 go sdk 1.11版本 VScode1.27.2) 

其中,gostudy是我的gopath路径,我的1.go文件在src路径下面

所以终端编译的时候应该是这样的:

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在 VB.NET 中,可以使用 `FindFirstFile` API 函数来检索文件。下面是一个示例代码: ``` Imports System.Runtime.InteropServices Public Class Form1 <DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> Private Shared Function FindFirstFile(lpFileName As String, ByRef lpFindFileData As WIN32_FIND_DATA) As IntPtr End Function <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> Private Structure WIN32_FIND_DATA Public dwFileAttributes As Integer Public ftCreationTime As System.Runtime.InteropServices.ComTypes.FILETIME Public ftLastAccessTime As System.Runtime.InteropServices.ComTypes.FILETIME Public ftLastWriteTime As System.Runtime.InteropServices.ComTypes.FILETIME Public nFileSizeHigh As Integer Public nFileSizeLow As Integer Public dwReserved0 As Integer Public dwReserved1 As Integer <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=260)> Public cFileName As String <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=14)> Public cAlternateFileName As String End Structure Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim lpFindFileData As WIN32_FIND_DATA Dim hFind As IntPtr = FindFirstFile("*.*", lpFindFileData) If hFind.ToInt32() <> -1 Then Do ' 处理找到的文件 Dim fileName As String = lpFindFileData.cFileName Console.WriteLine(fileName) Loop While FindNextFile(hFind, lpFindFileData) FindClose(hFind) Else ' 没有找到文件 Console.WriteLine("No files found.") End If End Sub End Class ``` 在这个例子中,我们使用了 `FindFirstFile` 函数和 `WIN32_FIND_DATA` 结构体来查找与给定模式匹配的第一个文件。然后,我们可以使用 `FindNextFile` 函数来枚举所有匹配的文件。最后,我们使用 `FindClose` 函数关闭搜索句柄。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值