如何使用libVLC列出网络共享中的所有文件(不仅仅是图像和视频)

huangapple go评论93阅读模式
英文:

How to list all files in network share (not just images and videos) with libVLC

问题

I want to use libVLC (C#) to browse network shares.

This works for me, but only for media files (images, videos, etc.)

Media media = new Media(new Uri(networkPath));
var parseTask = media.ParseAsync(_libVLC, MediaParseOptions.FetchNetwork);
Debug.WriteLine($"media.ParseAsync result: {parseTask.GetAwaiter().GetResult()}");
Debug.WriteLine($"media.SubItems.Count result: {media.SubItems.Count}");

Is there a flag or an alternative to Media class that scans for ALL files in the network share (e.g. txt, docx, pdf, odf files)?

I only need the file content as raw bytes, it is not necessary that libVLC understands the file format.

英文:

I want to use libVLC (C#) to browse network shares.

This works for me, but only for media files (images, videos, etc.)

    Media media = new Media(new Uri(networkPath));
    var parseTask = media.ParseAsync(_libVLC, MediaParseOptions.FetchNetwork);
    Debug.WriteLine($"media.ParseAsync result: {parseTask.GetAwaiter().GetResult()}");
    Debug.WriteLine($"media.SubItems.Count result: {media.SubItems.Count}");

Is there a flag or an alternative to Media class that scans for ALL files in the network share (e.g. txt, docx, pdf, odf files)?

I only need the file content as raw bytes, it is not necessary that libVLC understands the file format.

答案1

得分: 2

VLC是用于播放媒体的,而不是用于浏览Samba共享的。

我建议您尝试查看它们正在使用的库:https://github.com/sahlberg/libsmb2

也许您可以通过P/Invoke来使用它?

英文:

VLC is made to play media, not to be a samba share browser.

I'd recommend that you try to look into the library they're using : https://github.com/sahlberg/libsmb2

Maybe you'll be able to use it through P/Invoke ?

huangapple
  • 本文由 发表于 2023年3月3日 18:10:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/75625705.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定