@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: PathMatchSpec - Searches a string using a Microsoft MS-DOS wildcard match type. !!!!C# Signature: [DllImport("shlwapi.dll", CharSet=CharSet.Auto)] static extern bool PathMatchSpec([In] string pszFileParam, [In] string pszSpec); !!!!VB.NET Signature: ''' <summary> ''' Searches a string using a Microsoft MS-DOS wildcard match type. ''' </summary> ''' <param name="pszFile">A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be searched.</param> ''' <param name="pszSpec">A pointer to a null-terminated string of maximum length MAX_PATH that contains the file type for which to search. For example, to test whether pszFile is a .doc file, pszSpec should be set to "*.doc".</param> ''' <returns>Returns TRUE if the string matches, or FALSE otherwise.</returns> <DllImport("shlwapi.dll", EntryPoint:="PathMatchSpecW", SetLastError:=True, CharSet:=CharSet.Unicode)> _ Public Function PathMatchSpec(<MarshalAs(UnmanagedType.LPTStr)>pszFile As String, _ <MarshalAs(UnmanagedType.LPTStr)>pszSpec As String) As <MarshalAs(UnmanagedType.Bool)> Boolean End Function !!!!VB Signature: Private Declare Auto Function PathMatchSpec Lib "shlwapi" _ (ByVal pszFileParam As String, _ ByVal pszSpec As String) As Boolean !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: !!!!!C# Example if(PathMatchSpec("C:\\test.txt", "*.txt")) { // This is text file. } !!!!!VB.NET Example Private Function MatchSpec(ByVal sFile As String, ByVal sSpec As String) As Boolean Return PathMatchSpec(sFile, sSpec) End Function !!!!!VB Example Private Function MatchSpec(ByVal sFile As String, ByVal sSpec As String) As Boolean MatchSpec = PathMatchSpec(sFile, sSpec) End Function !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: PathMatchSpec@msdn on MSDN
Edit shlwapi.pathmatch...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.