我无法让 WEBMethods 写入我公司的网络驱动器。但是,我可以通过 C# 中的简单调用访问网络驱动器,但不能在 Java 中访问。网络驱动器和本地驱动器 Q: 驱动器共享到同一位置。所以我应该能够通过驱动器名称和服务器或通过 Q: 驱动器访问驱动器。
我更改了驱动器名称,以便看不到可能告诉某人驱动器名称的信息。
问题:为什么我可以通过 C#(读写)而不是 Java 访问我的 Q: 驱动器?
代码:(Java)
writer = new PrintWriter(new BufferedWriter(new FileWriter("\\\\A\\B\\S\\A B\\P\\T\TWM\\" + matcher.group(1) + ".txt")));
C#代码:
class Program
{
static void Main(string[] args)
{
//Read the file as one string.
string text1 = System.IO.File.ReadAllText(@"Q:\\S\ABCPS\T\TWM\T.txt");
//string text1 = System.IO.File.ReadAllText(@"\\E5\D\SYS\Tes\T.txt");
//string text1 = System.IO.File.ReadAllText(@"\\DS\ES\S\ABKS\T\TM\T.txt");
System.Console.WriteLine("Contents of WriteText.txt = {0}", text1);
string myLine = "Test line of code!!!!";
System.IO.File.WriteAllText(@"Q:SY\ACS\T\U\N.txt", myLine);
Console.WriteLine("Press any key to exit.");
System.Console.ReadKey();
}
}