サーバ上に配置した、VB.net(.NetFrameWork2.0)で作成した、サーバ上のテキストファイルをオープン~1行書込み~Closeを繰り返すアプリケーションをWindows10クライアントからショートカットで実行時に、ファイルオープンもしくは書き込み時に「指定されたネットワーク名は利用できません」という例外エラーが不定期に発生します。
異常が発生するWin10クライアントと同一ネットワーク内にあるWin7クライアントではエラーは発生しません。
使用しているサーバはWindows Server 2012 R2、別セグメントに存在します。
当該エラーの発生原因をご教示下さい。
追記
当該アプリケーションのソースコードを追加します。
Imports System.Net Public Class Form1 Public LogPath As String = "" Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" _ (ByVal lpApplicationName As String, _ ByVal lpKeyName As String, _ ByVal lpDefault As String, _ ByVal lpReturnedString As String, _ ByVal nSize As Integer, _ ByVal lpFileName As String) As Long Private Sub Button1_Click( sender As System.Object, e As System.EventArgs) Handles Button1.Click If Timer1.Enabled = False then Timer1.Enabled = True End If Button1.Enabled = False Button2.Enabled = True Button3.Enabled = False End Sub Private Sub Button2_Click( sender As System.Object, e As System.EventArgs) Handles Button2.Click If Timer1.Enabled = True then Timer1.Enabled = False End If Button1.Enabled = True Button2.Enabled = False Button3.Enabled = True End Sub Private Sub Button3_Click( sender As System.Object, e As System.EventArgs) Handles Button3.Click If Timer1.Enabled = False then End End If End Sub Private Sub Form1_Load( sender As System.Object, e As System.EventArgs) Handles MyBase.Load Timer1.Interval = 100 Timer1.Enabled = False Button1.Enabled = True Button2.Enabled = False Button3.Enabled = True Dim strResult As String = Space(255) Call GetPrivateProfileString("WEB", "LOG", "", _ strResult, Len(strResult), _ "web.ini") LogPath =GetIniFile("WEB", "LOG", "bsweb.ini") End Sub Private Sub Timer1_Tick( sender As System.Object, e As System.EventArgs) Handles Timer1.Tick Dim FName As String = "" Dim fno As Integer Dim HostName as String = "" If Not NTGetHostName(HostName) then End End If FName = LogPath & "\TEST_" & HostName & "_" & Now.ToString("yyyyMMdd") & ".log" fno = FreeFile() FileSystem.FileOpen(fno, FName, OpenMode.Append, OpenAccess.Write) FileSystem.Print(fno, Now.ToString("yy/MM/dd HH:mm:ss") & vbCrLf) FileSystem.FileClose(fno) End Sub Public Function GetIniFile(ByVal section As String, _ ByVal entry As String, _ ByVal iniFile As String) As String '!! GetIniFile = GetIni(section, entry, GetAppPath() & "\" & iniFile) Exit Function End Function Public Function GetIni(ByVal section As String, _ ByVal entry As String, _ ByVal iniFile As String) As String Dim strResult As String = Space(255) Call GetPrivateProfileString(section, entry, "", _ strResult, Len(strResult), _ iniFile) GetIni = Microsoft.VisualBasic.Left(strResult, _ InStr(strResult, Chr(0)) - 1) End Function Private Function GetAppPath() As String Return System.IO.Path.GetDirectoryName( _ System.Reflection.Assembly.GetExecutingAssembly().Location) End Function Public Function NTGetHostName(ByRef sHostName As String) As Boolean Try sHostName = Dns.GetHostName() NTGetHostName = True Catch ex As Exception NTGetHostName = False NTError() End Try End Function Private Sub NTError(Optional ByVal sPlus As String = "") Dim vErrMsg1 As String Dim vRc As Integer vErrMsg1 = strings.Right("000000" & Err.Number, 6) & ":" & Err.Description If sPlus = "" Then vErrMsg1 = vErrMsg1 & vbCrLf Else vErrMsg1 = vErrMsg1 & vbCrLf & "補足説明:" & sPlus End If vRc = MsgBox("ネットワークエラー" & vbCrLf & vErrMsg1, vbCritical) End Sub End Class
以上のコードをForm内に記載、ボタンを3つ並べ、Button1クリック時にTimer1のEnabledをTrueにし、Timer1_Tick内で Button2がクリックされるまでテキストファイルへの処理を繰り返し、Button3
でアプリケーションを終了しています。
ソースコードの開示方法がこれでよいか不安ですが、引き続きアドバイスの程よろしくお願い致します。
--マルチポストについて
SurferOnWww様
恥ずかしながらご指摘を受けるまで「マルチポスト」を知りませんでした。
御無礼をお詫びいたしますと共に、MSDN側での質問は完了とさせて頂きました。
引き続きアドバイスの程よろしくお願い致します。

