
Revisited - VB.NET Build Comment Web Pages
I guess I did not explain this very well. Here is an
example of what I mean. I write the following Function in
VB.NET:
Public Sub MyFunction(strMyString as String) as Boolean
If Len(Trim(strMyString)) = 0 then
return True
End If
End Function
Now, if I add the following comments to this function:
' <summary> This function checks the incoming string to
' see if it contains any characters </summary>
'
' <param name="strMyString">Incoming string to check for
' characters</param>
' <return>When True, indicates the incomine string
' is empty</return>
' <remarks>This is an example of using XML code commenting
' to be recognized by the Code Comment Web Reporter
' </remarks>
Public Sub MyFunction(strMyString as String) as Boolean
If Len(Trim(strMyString)) = 0 then
return True
End If
End Function
Then I select Tools - Build Comment Web Pages in Visual
Studio .NET. I hoped that an HTML report would be
generated from the comments inserted in my code, in order
to generate documentation for my function for other
programmers to use who might maintain or use this
function. It looks like you can do this in C#, but not
VB.NET .... Is that true? Is there an Add In specifically
for VB.NET to gain this functionality?
Quote:
>-----Original Message-----
>You mean something like this?
> 'this is entirely new syntax for wmi
> 'instead of having to dim a locator and services
object, we call the
>managementobjectsearcher
> 'totally cool
> Dim mos As
System.Management.ManagementObjectSearcher
Quote:
> Dim moc As
System.Management.ManagementObjectCollection
Quote:
> Dim mo As System.Management.ManagementObject
> Dim prop As System.Management.PropertyData
> Dim FSO As Object
> Dim txtstream As Object
> Dim MyString As String
> mos = New
System.Management.ManagementObjectSearcher("SELECT * FROM
Quote:
>Win32_BIOS")
> moc = mos.Get()
> For Each mo In moc
> FSO = CreateObject
("Scripting.filesystemobject")
Quote:
> txtstream = FSO.OpenTextFile
("Win32_BIOS.htm", 2, True, -2)
Quote:
> txtstream.writeline("<HTML>")
> txtstream.writeline("<HEAD>")
> txtstream.writeline
("<TITLE>Win32_BIOS</TITLE>")
Quote:
> txtstream.writeline("</HEAD>")
> txtstream.writeline("<XML ID=""RS"">")
> txtstream.writeline("<?xml version=""1.0""
>encoding=""iso-8859-1""?>")
> txtstream.writeline("<Data>")
> txtstream.writeline("<Win32_BIOS>")
> For Each prop In mo.Properties
> On Error Resume Next
> If IsNothing(prop.Value) = True Then
> txtstream.writeline("<" + prop.Name
+ "></" + prop.Name
>+ ">")
> Else
> txtstream.writeline("<" + prop.Name
+ ">" +
>Trim(prop.Value) + "</" + prop.Name + ">")
> Err.Clear()
> End If
> Next
> txtstream.writeline("</Win32_BIOS>")
> txtstream.writeline("</Data>")
> txtstream.writeline("</XML>")
> txtstream.writeline("<BODY
BGCOLOR=""Darkblue""
Quote:
>Text=""White"">")
> txtstream.writeline("<Table Border=""1""
colspacing=""10"">")
Quote:
> For Each prop In mo.Properties
> txtstream.writeline("<TR>")
> txtstream.writeline("<TH Align=Center
Nowrap=True
>STYLE=""Border:None;Background-color:Silver;Font-
Family:Tahoma;Font-Size:14;
Quote:
>Font-
Weight:bold;Color:Yellow;filter:ProgID:DXImageTransform.Mic
rosoft.Gradi
Quote:
>ent(gradientType=0, StartColorStr='Silver',
endColorstr='Black')"">" +
Quote:
>prop.Name + "</TH>")
> txtstream.writeline("<TD Align=Center
Nowrap=True
>STYLE=""Border:none;Color:white;Font-Family:Tahoma;Font-
Size:12;Font-weight:
Quote:
>Bold;width:100%;filter:ProgID:DXImageTransform.Microsoft.G
radient(gradientTy
>pe=0, StartColorStr='Red', endColorstr='Black')""><SPAN
datasrc=#RS
>datafld=" + Chr(34) + prop.Name + Chr(34)
+ "></SPAN></TD>")
> txtstream.write("</TR>")
> Next
> txtstream.write("</TABLE>")
> txtstream.write("</BODY>")
> txtstream.write("</HTML>")
> txtstream.close()
> Exit For
> Next
> txtstream = Nothing
> FSO = Nothing
> End Sub
message
>> I've been trying to figure out how to comment my VB .NET
>> in such a way as to allow me to use the VS .NET feture
>> under the Tools - Build Comment Web Pages. From all the
>> MSDN library help I've read, it looks like the only
>> laguages that support this is C#. J# looks like it has
>> its own documentation generator that work with the
javadoc
>> stadards of documenting code. Does VB .NET have this
>> capablility? Will it in the future? We have used a
tool
>> called VBDox to generate Web based documentation from
our
>> code documentation for VB 6.0 programs. This is an
>> important feature that I wish VB .NET had
>.
.