如何修复BC30035语法错误? [英] How do I fix BC30035 syntax error?
本文介绍了如何修复BC30035语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图将C#代码转换为VB.Net但是我在括号内的行中收到一个语法错误,以单词开头(New SubmitDocumentRequest + ProcessSubmitDocumentRequestMessage())
如何修复这个?
这是C#代码
I have tried to convert C# code to VB.Net but I am getting an Syntax error in the line inside brackets starting with the word (New SubmitDocumentRequest + ProcessSubmitDocumentRequestMessage())
How do I fix this?
Here is C# code
try
{
strMessageType = objXmlContentDoc.DocumentElement.LocalName;
switch (strMessageType)
{
case "SubmitDocumentRequestMessage":
new SubmitDocumentRequest().ProcessSubmitDocumentRequestMessage(ref aobjXMLInputSoapEnvelopeDoc, ref objXmlContentDoc);
break;
default:
throw new System.Exception("Unknown Message Type");
}
catch (System.Exception ex)
{
aobjBroker.PostMessageWarehouseInformationalMessage("System Error: " + ex.Message, 3);
return;
}
这是我转换为VB.Net的代码,语法错误< br $> b $ b
Here is the code I converted to VB.Net with syntax error
Try
strMessageType = objXmlContentDoc.DocumentElement.LocalName
Select Case strMessageType
Case "SubmitDocumentRequestMessage"
(New SubmitDocumentRequest + ProcessSubmitDocumentRequestMessage(aobjXMLInputSoapEnvelopeDoc, objXmlContentDoc))
Case Else
Throw New System.Exception("Unknown Message Type")
End Select
Catch ex As System.Exception("System Error: " + ex.Message, 3)
Return
End Try
我尝试过:
What I have tried:
Try
strMessageType = objXmlContentDoc.DocumentElement.LocalName
Select Case strMessageType
Case "SubmitDocumentRequestMessage"
(New SubmitDocumentRequest + ProcessSubmitDocumentRequestMessage(aobjXMLInputSoapEnvelopeDoc, objXmlContentDoc))
Case Else
Throw New System.Exception("Unknown Message Type")
End Select
Catch ex As System.Exception("System Error: " + ex.Message, 3)
Return
End Try
推荐答案
你不需要+符号来继续新行代码。
你还必须返回一个对象调用方法。您的代码似乎想要创建SubmitDocumentRequest.ProcessSubmitDocumentRequestMessage的实例。这对于在对象上调用方法不起作用。
为了使您的调试生活更轻松,请不要使用快捷方式。试试这种方式:
You don't need the "+' sign to continue a ling of code on a new line.
You also have to return an object to call the method on. Your code seems to want to create an instance of "SubmitDocumentRequest.ProcessSubmitDocumentRequestMessage". That doesn't work for calling a method on an object.
To make your debugging life easier, don't use shortcuts. Try it this way:
Try
strMessageType = objXmlContentDoc.DocumentElement.LocalName
Select Case strMessageType
Case "SubmitDocumentRequestMessage"
Dim request As New SubbmitDocumentRequest
request.ProcessSubmitDocumentRequestMessage(aobjXMLInputSoapEnvelopeDoc, objXmlContentDoc)
Case Else
Throw New System.Exception("Unknown Message Type")
End Select
Catch ex As System.Exception("System Error: " + ex.Message, 3)
Return
End Try
strMessageType
在使用之前没有先声明>。
strMessageType
is not declared first before using.
我不再需要这个帮助。
这篇关于如何修复BC30035语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文