Click here to Skip to main content
15,881,089 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: call a server side Powershell script? Pin
Joseline Riker3-Dec-21 7:34
Joseline Riker3-Dec-21 7:34 
GeneralRe: call a server side Powershell script? Pin
Richard Deeming5-Dec-21 21:43
mveRichard Deeming5-Dec-21 21:43 
QuestionIs it possible to use SQLite instead of MSSQL SERVER in ASP.NET projects? Pin
Alex Dunlop17-Nov-21 21:29
Alex Dunlop17-Nov-21 21:29 
AnswerRe: Is it possible to use SQLight instead of MSSQL SERVER in ASP.NET projects? Pin
Richard Deeming17-Nov-21 21:45
mveRichard Deeming17-Nov-21 21:45 
Questioncheckbox inserting null value in a custom templatefield (vb.net) Pin
Oliver Freeman27-Oct-21 2:56
Oliver Freeman27-Oct-21 2:56 
QuestionCan shell32.dll be used in IIS environment? Pin
Member 35932620-Oct-21 10:11
Member 35932620-Oct-21 10:11 
AnswerRe: Can shell32.dll be used in IIS environment? Pin
Richard Deeming20-Oct-21 22:17
mveRichard Deeming20-Oct-21 22:17 
GeneralRe: Can shell32.dll be used in IIS environment? Pin
Member 35932620-Oct-21 23:54
Member 35932620-Oct-21 23:54 
Here is the API in MVC controller:
public JsonResult GetMusicFiles()
        {
            List list = new();
            FILE_PATH = @"D:\medias\musics";
            list = Helpers.MediaMetaData.SingleDir(FILE_PATH);
            foreach (ClassMediaMetaData d in list) { 
                Console.WriteLine(d.FullFileName);
            }
            return new JsonResult("Success!");
        }


Here is the function in a class
class MediaMetaData
    {
        [STAThread]
        public static List SingleDir(string folder)
        {
            return GetFilesSingleDir(folder);
        }
      
        private static List GetFilesSingleDir(String folder)
        {
            TimeSpan dur = TimeSpan.Zero;
            Shell32.Shell shell = new Shell32.Shell();
            Shell32.Folder objFolder = shell.NameSpace(folder);
            List list = new();
            list.Clear();
            foreach (FolderItem2 item in objFolder.Items())
            {
                if (!item.IsFolder)
                {
                    ClassMediaMetaData md = new ClassMediaMetaData();
                    dur = TimeSpan.FromSeconds(item.ExtendedProperty("System.Media.Duration") / 10000000);
                    md.Duration = dur.Duration();
                    md.FullFileName = item.Name;
                    md.FullPath = folder;
                    list.Add(md);
                }
            }
            return list;
        }
		...


I am using VS2019 with DotNet CORE 5.0 to compile this.
When I used the class in a console application, it works fine. Therefore I know the code is working. The diff is one is console app and the other one is web or IIS.
Thanks.
GeneralRe: Can shell32.dll be used in IIS environment? Pin
Richard Deeming21-Oct-21 1:09
mveRichard Deeming21-Oct-21 1:09 
GeneralRe: Can shell32.dll be used in IIS environment? Pin
Member 35932621-Oct-21 22:46
Member 35932621-Oct-21 22:46 
AnswerRe: web config asp.net project of sql server Pin
Richard MacCutchan12-Sep-21 22:08
mveRichard MacCutchan12-Sep-21 22:08 
AnswerRe: web config asp.net project of sql server Pin
Dave Kreskowiak13-Sep-21 1:18
mveDave Kreskowiak13-Sep-21 1:18 
QuestionGet a Field value for recovery a password Pin
Luis M. Rojas3-Sep-21 5:17
Luis M. Rojas3-Sep-21 5:17 
AnswerRe: Get a Field value for recovery a password Pin
Richard Deeming3-Sep-21 5:34
mveRichard Deeming3-Sep-21 5:34 
GeneralRe: Get a Field value for recovery a password Pin
Luis M. Rojas3-Sep-21 5:55
Luis M. Rojas3-Sep-21 5:55 
GeneralRe: Get a Field value for recovery a password Pin
Richard Deeming3-Sep-21 6:10
mveRichard Deeming3-Sep-21 6:10 
QuestionWebService just will not work :-( Pin
Oliver Freeman1-Sep-21 5:48
Oliver Freeman1-Sep-21 5:48 
AnswerRe: WebService just will not work :-( Pin
Richard Deeming1-Sep-21 21:59
mveRichard Deeming1-Sep-21 21:59 
GeneralRe: WebService just will not work :-( Pin
Oliver Freeman2-Sep-21 1:59
Oliver Freeman2-Sep-21 1:59 
GeneralRe: WebService just will not work :-( Pin
DerekT-P21-Oct-21 7:37
professionalDerekT-P21-Oct-21 7:37 
QuestionIs it possible to add fore ground and back ground to any app that is down? Pin
samflex31-Aug-21 18:39
samflex31-Aug-21 18:39 
AnswerRe: Is it possible to add fore ground and back ground to any app that is down? Pin
Richard Deeming31-Aug-21 22:01
mveRichard Deeming31-Aug-21 22:01 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
samflex1-Sep-21 5:50
samflex1-Sep-21 5:50 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
Richard Deeming1-Sep-21 21:47
mveRichard Deeming1-Sep-21 21:47 
GeneralRe: Is it possible to add fore ground and back ground to any app that is down? Pin
samflex2-Sep-21 3:02
samflex2-Sep-21 3:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.