简体   繁体   English

C#exe在目标平台x86上不起作用

[英]C# exe not working on target platform x86

so, I'm trying to log accesses to my shared files on the network (I'm modifying Abdollah Zawari's ShareMoniter ), i do this by starting openfiles.exe like so: 因此,我试图记录对网络上共享文件的访问(我正在修改Abdollah Zawari的ShareMoniter ),我可以这样启动openfiles.exe来做到这一点:

        var process = new Process();
        process.StartInfo.FileName = "openfiles.exe";
        process.StartInfo.Arguments = "/query /FO CSV /v";
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.CreateNoWindow = true;
        process.StartInfo.RedirectStandardOutput = true;
        try
        {
            process.Start();
            if ((process.StandardOutput != null))
            {
                var result = process.StandardOutput.ReadToEnd().Trim().Replace("\"", "");
                var lines = result.Split('\n');...

I want to log the results in an Access database, but jet.Oledb.4.0 or ace.oledb.12.0 only work when I set the project's target platform to x86. 我想将结果记录在Access数据库中,但是jet.Oledb.4.0或ace.oledb.12.0仅在将项目的目标平台设置为x86时才起作用。

problem is, openfiles.exe doesn't return anything when i run the project for x86 (openfiles.exe starts and ends with no apparent error, but an empty string "" is returned) 问题是,当我为x86运行项目时,openfiles.exe不会返回任何内容(openfiles.exe的开始和结束都没有明显的错误,但返回的是空字符串“”)

I'm very much a newbie, especially in these fields, so any advice on the matter would be greatly appreciated 我是一个新手,尤其是在这些领域,所以对此事的任何建议将不胜感激

thanks in advence 提前感谢

The version of the Oledb you are using does not support 64bit, you need to use a newer version that works on both 32 & 64 bit. 您使用的Oledb版本不支持64位,您需要使用在32位和64位版本上均可使用的较新版本。 Use the Microsoft Access Database Engine 2010 instead to access the database and things will be fine. 而是使用Microsoft Access数据库引擎2010来访问数据库,一切都会好起来的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 c#visual studio使用目标anycpu构建exe,但在调用进程平台(x86 / x64)上确定其平台(x86 / x64) - c# visual studio build exe with target anycpu but that determines its platform(x86/x64) on the calling process platform(x86/x64) VS2005 .NET 2.0和C#和x86目标平台 - VS2005 .NET 2.0 and C# and x86 target platform 针对 amd64 与项目的目标平台 x86 c# 不兼容 - targeting amd64 is not compatible with the project's target platform x86 c# 平台目标x86和任何CPU - Platform target x86 and Any CPU Visual Studio C# 目标平台 x86 但 nuget package 在我看来是 x64 - 程序运行时出错 - Visual Studio C# target platform x86 but nuget package seems to me x64 - error when program runs 除非为 x86 平台构建,否则不安全的 c# 代码会导致 64 位平台上的堆损坏 - unsafe c# code causes heap corruption on 64 bit platform unless built for x86 platform 如果平台目标不是 x86,则生成编译器错误 - Generate compiler error if platform target is not x86 根据 x64/x86 更改 C# DllImport 目标代码 - Change C# DllImport target code depending on x64/x86 无法在Visual Studio 2008 C#Express Edition中将平台设置为x86 - Can't set platform to x86 in Visual Studio 2008 C# Express Edition C#解决方案,除了必须是x86之外,所有项目都可以针对AnyCPU吗? - C# Solution, can all projects target AnyCPU except one which has to be x86?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM