I am trying to verify the backup I have just done in c# using command against sql server Express
string _commandText = string.Format(\"RESTORE VERIFYONLY F
Its pretty difficult to retrieve the ssms message to the front end application . However you can write the message into a text file and then read the data from the file .
declare @cmd varchar(1000)
SET @cmd = 'osql -S YourServer -E -d YourDatabase -q "RESTORE VERIFYONLY FROM DISK=''c:\yourBackup.bkp''" -o c:\result.txt'
EXEC master.dbo.xp_cmdshell @cmd
You can execute the above sql statements from your application and then read the result from the result.txt file