問題タブ [system.io.fileinfo]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
68 参照

c# - if-query で linq を使用する

FileInfos のリストをグループ化する次のコードがあります。

今、グループクローセルでifクエリを実行したいと考えています。多分文字列の助けを借りて

または列挙:

しかし、group-clauselで文字列または列挙型をチェックする方法がわかりません。次のような構文があることは知っています

しかし、これにより、2 つの属性を選択することができます...

アイデアはありますか?

0 投票する
2 に答える
314 参照

c# - Can't get around IOException error: Cannot access the file

I am having a hard time trying to figure out this IOException. This method used to work flawless until about two months ago. The only change I have made to it was moving the parsed file to another folder, which also worked for awhile. Now every time the custom Windows Filewatcher Service gets to this method, I get the following error message:

I can't figure out what process it could be because it craps out at the beginning right after it writes to the log. Our instrument creates the .csv file and sends it to the network folder location that is being watched. Then the service is initiated. The parsing is the first thing that happens in the service. I would appreciate any help on this.

Here is the code for the Parsing Method:

0 投票する
1 に答える
357 参照

fileinfo - パスに不正な文字があります。ディレクトリの検索

ファイルを読み取ってパスを取得し、そのパスを検索しようとしています。

C:\Users\Public\Documents\ScriptPath.txt には「C:\Users\Public\Music Folder\」が含まれています

ここに私のコードがあります

私が得るエラーはこれです。

ArgumentException が処理されませんでした

タイプ 'System.ArgumentException' の未処理の例外が mscorlib.dll で発生しました

追加情報: パスに不正な文字があります。

なぜこれが機能しないのかを理解するのを手伝ってくれる人がいれば、私は感謝しています。