public static void SetCodeMessage(WiaExceptionCode code,string message)
Public Shared Sub SetCodeMessage( _ByVal code As WiaExceptionCode, _ByVal message As String _)
public:static void SetCodeMessage(WiaExceptionCode code,String^ message)
code
A WiaExceptionCode value for which the error string is being set.
message
A System.String that contains the new message for code.
By default, WiaException has a string message for each WiaExceptionCode. You can get this message by using the GetCodeMessage method. Also, you can change any string message for any WiaExceptionCode by using the SetCodeMessage method.
using Leadtools;using Leadtools.Wia;public void SetCodeMessageExample(){// Get the initial FileFormat messageWiaExceptionCode code = WiaExceptionCode.PaperEmpty;string message = WiaException.GetCodeMessage(code);MessageBox.Show(string.Format("Code: {0}, message: {1}", code, message));// make sure that this message is used nowtry{throw new WiaException(code);}catch (Exception ex){MessageBox.Show(ex.Message);}// change this message to a custom oneWiaException.SetCodeMessage(code, "My new message");// make sure that this new message is used nowtry{throw new WiaException(code);}catch (Exception ex){MessageBox.Show(ex.Message);}}
Imports LeadtoolsImports Leadtools.WiaPublic Sub SetCodeMessageExample()' Get the initial FileFormat messageDim code As WiaExceptionCode = WiaExceptionCode.PaperEmptyDim message As String = WiaException.GetCodeMessage(code)MessageBox.Show(String.Format("Code: {0}, message: {1}", code, message))' make sure that this message is used nowTryThrow New WiaException(code)Catch ex As ExceptionMessageBox.Show(ex.Message)End Try' change this message to a custom oneWiaException.SetCodeMessage(code, "My new message")' make sure that this new message is used nowTryThrow New WiaException(code)Catch ex As ExceptionMessageBox.Show(ex.Message)End TryEnd Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
