Click here to Skip to main content
15,885,546 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Is this data annotation correct for date and time? Pin
Alex Dunlop26-Nov-21 0:45
Alex Dunlop26-Nov-21 0:45 
GeneralRe: Is this data annotation correct for date and time? Pin
Richard MacCutchan26-Nov-21 0:56
mveRichard MacCutchan26-Nov-21 0:56 
AnswerRe: Is this data annotation correct for date and time? Pin
jkirkerx28-Nov-21 9:12
professionaljkirkerx28-Nov-21 9:12 
QuestionCannot establish local connection to SQL SERVER Pin
Alex Dunlop24-Nov-21 23:15
Alex Dunlop24-Nov-21 23:15 
QuestionRe: Cannot establish local connection to SQL SERVER Pin
Richard MacCutchan25-Nov-21 0:37
mveRichard MacCutchan25-Nov-21 0:37 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
Richard Deeming25-Nov-21 1:15
mveRichard Deeming25-Nov-21 1:15 
GeneralRe: Cannot establish local connection to SQL SERVER Pin
Richard MacCutchan25-Nov-21 1:18
mveRichard MacCutchan25-Nov-21 1:18 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
Richard Deeming25-Nov-21 1:19
mveRichard Deeming25-Nov-21 1:19 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
jsc4225-Nov-21 2:56
professionaljsc4225-Nov-21 2:56 
GeneralRe: Cannot establish local connection to SQL SERVER Pin
Richard Deeming25-Nov-21 3:33
mveRichard Deeming25-Nov-21 3:33 
AnswerRe: Cannot establish local connection to SQL SERVER Pin
Alex Dunlop25-Nov-21 9:02
Alex Dunlop25-Nov-21 9:02 
Questioncall a server side Powershell script? Pin
Joseline Riker19-Nov-21 6:44
Joseline Riker19-Nov-21 6:44 
AnswerRe: call a server side Powershell script? Pin
Richard Deeming21-Nov-21 22:52
mveRichard Deeming21-Nov-21 22:52 
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 

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.