/查询C:\\Windows\\System32路径下所有结尾是.dll的文件

本文提供了一个使用Java编程语言查询指定路径下所有以.dll为后缀的文件的代码示例。通过使用File类的listFiles()方法和String类的endsWith()方法,可以轻松实现这一功能。
<span style="font-size:18px;">import java.io.File;

//查询C:\\Windows\\System32路径下所有结尾是.dll的文件 .
//知識點:string.endsWith();
//.listFiles()
public class FileDemo3 {
	public static void main(String[] args) {
		File file = new File("C:\\Windows\\System32");
		File[] listFiles = file.listFiles();
		for (File temp : listFiles)
			if (temp.isFile() && temp.getName().endsWith(".dll"))
				System.out.println(temp.getName());
	}

}
</span>


有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。 ************** 异常文本 ************** System.UnauthorizedAccessException: 拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED)) 在 IWshRuntimeLibrary.IWshShortcut.Save() 在 StartUp.StartupApp.button2_Click(Object sender, EventArgs e) 位置 D:\VS2022\C#StartUp开机启动\StartUp\StartUp\Form1.cs:行号 148 在 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** 已加载的程序集 ************** mscorlib 程序集版本:4.0.0.0 Win32 版本:4.8.9310.0 built by: NET481REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll ---------------------------------------- StartUp 程序集版本:1.0.0.0 Win32 版本:1.0.0.0 基本代码:file:///D:/VS2022/C%23StartUp%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8/StartUp/StartUp/bin/Debug/StartUp.exe ---------------------------------------- System.Windows.Forms 程序集版本:4.0.0.0 Win32 版本:4.8.9251.0 built by: NET481REL1LAST_C 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System 程序集版本:4.0.0.0 Win32 版本:4.8.9310.0 built by: NET481REL1LAST_C 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Core 程序集版本:4.0.0.0 Win32 版本:4.8.9297.0 built by: NET481REL1LAST_C 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Xml 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Accessibility 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- Microsoft.CSharp 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll ---------------------------------------- System.Dynamic 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dll ---------------------------------------- Anonymously Hosted DynamicMethods Assembly 程序集版本:0.0.0.0 Win32 版本:4.8.9310.0 built by: NET481REL1LAST_C 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll ---------------------------------------- mscorlib.resources 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll ---------------------------------------- System.Windows.Forms.resources 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- ************** JIT 调试 ************** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。 例如: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> 启用 JIT 调试后,任何未经处理的异常 都将被发送到在此计算机上注册的 JIT 调试程序, 而不是由此对话框处理。
最新发布
06-09
C# 有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾。 ************** 异常文本 ************** System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.TypeInitializationException: “FreeSql.MySql.MySqlCodeFirst”的类型初始值设定项引发异常。 ---> System.IO.FileLoadException: 未能加载文件或程序集“MySql.Data, Version=6.9.12.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040) 在 FreeSql.MySql.MySqlCodeFirst..cctor() --- 内部异常堆栈跟踪的结尾 --- 在 FreeSql.MySql.MySqlCodeFirst..ctor(IFreeSql orm, CommonUtils commonUtils, CommonExpression commonExpression) 在 FreeSql.MySql.MySqlProvider`1..ctor(String masterConnectionString, String[] slaveConnectionString, Func`1 connectionFactory) --- 内部异常堆栈跟踪的结尾 --- 在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 在 System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) 在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) 在 System.Activator.CreateInstance(Type type, Object[] args) 在 FreeSql.FreeSqlBuilder.Build[TMark]() 在 FreeSql.FreeSqlBuilder.Build() 在 WindowsFormsApp1.FrmMain.btnSelect_Click(Object sender, EventArgs e) 位置 E:\吴亮亮写的软件\信息化查询软件\查询软件\20250529可视化查询软件-增加TG40\可视化查询软件\WindowsFormsApp1\WindowsFormsApp1\FrmMain.cs:行号 248 在 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** 已加载的程序集 ************** mscorlib 程序集版本:4.0.0.0 Win32 版本:4.8.9310.0 built by: NET481REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll ---------------------------------------- WindowsFormsApp1 程序集版本:1.0.0.0 Win32 版本:1.0.0.0 基本代码:file:///E:/%E5%90%B4%E4%BA%AE%E4%BA%AE%E5%86%99%E7%9A%84%E8%BD%AF%E4%BB%B6/%E4%BF%A1%E6%81%AF%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/20250529%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6-%E5%A2%9E%E5%8A%A0TG40/%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/Win.exe ---------------------------------------- System.Windows.Forms 程序集版本:4.0.0.0 Win32 版本:4.8.9251.0 built by: NET481REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System 程序集版本:4.0.0.0 Win32 版本:4.8.9310.0 built by: NET481REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Configuration 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Core 程序集版本:4.0.0.0 Win32 版本:4.8.9297.0 built by: NET481REL1LAST_C 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- System.Xml 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Windows.Forms.resources 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- Accessibility 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- FreeSql 程序集版本:3.2.805.0 Win32 版本:3.2.805.0 基本代码:file:///E:/%E5%90%B4%E4%BA%AE%E4%BA%AE%E5%86%99%E7%9A%84%E8%BD%AF%E4%BB%B6/%E4%BF%A1%E6%81%AF%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/20250529%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6-%E5%A2%9E%E5%8A%A0TG40/%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/FreeSql.DLL ---------------------------------------- System.Data 程序集版本:4.0.0.0 Win32 版本:4.8.9214.0 built by: NET481REL1LAST_B 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Numerics 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll ---------------------------------------- FreeSql.Provider.MySql 程序集版本:3.2.805.0 Win32 版本:3.2.805.0 基本代码:file:///E:/%E5%90%B4%E4%BA%AE%E4%BA%AE%E5%86%99%E7%9A%84%E8%BD%AF%E4%BB%B6/%E4%BF%A1%E6%81%AF%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/20250529%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6-%E5%A2%9E%E5%8A%A0TG40/%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/FreeSql.Provider.MySql.DLL ---------------------------------------- FreeSql.resources 程序集版本:3.2.805.0 Win32 版本:3.2.805.0 基本代码:file:///E:/%E5%90%B4%E4%BA%AE%E4%BA%AE%E5%86%99%E7%9A%84%E8%BD%AF%E4%BB%B6/%E4%BF%A1%E6%81%AF%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/20250529%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6-%E5%A2%9E%E5%8A%A0TG40/%E5%8F%AF%E8%A7%86%E5%8C%96%E6%9F%A5%E8%AF%A2%E8%BD%AF%E4%BB%B6/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/zh-Hans/FreeSql.resources.DLL ---------------------------------------- mscorlib.resources 程序集版本:4.0.0.0 Win32 版本:4.8.9037.0 built by: NET481REL1 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll ---------------------------------------- ************** JIT 调试 ************** 要启用实时(JIT)调试, 该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置 jitDebugging 值。 编译应用程序时还必须启用 调试。 例如: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> 启用 JIT 调试后,任何未经处理的异常 都将被发送到在此计算机上注册的 JIT 调试程序, 而不是由此对话框处理。
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值