2013-08-20 69 views
0

我需要使用Visual Studio 2005從字段中提取特定的信息。我只需要來自此字段的'partNumber'和'serialNumber';使用Visual Studio 2005從字段中提取信息

請將BeginGroup:databasecurrentFifos = 0maximumFifos = 34369maximumSpace = 6291456percentUsed = 7totalFixedSpace = 123156totalIndexSpace = 77182totalRowCount = 2533totalRowSpace = 139024totalTableSpace = 339362uncollectedFifos = 0usedSpace = 478386EndGroup:databaseBeginGroup:networkDNS_ServerIP = NoneDNS_DomainName = NoneFTP_Enabled = falseEndGroup:networkBeginGroup:hardwareBeginGroup:biometricsEndGroup:biometricsBeginGroup: mSystemformat = 7101processorType = 859chipId = CFEndGroup:mSystemBeginGroup:barcodesBarcode_attached = noSymbologies = code3of9 i2of5 code128Remote_Barcode_attached = noEndGroup:barcodesBeginGroup:boardrevision = REV 厭惡= 415partNumber = 8602800-503serialNumber = JC117590EndGroup:boardBeginGroup:magneticstrackNum = noEndGroup:magneticsBeginGro起來:memorySDRAM = 134217728BeginGroup:flashDisksflashDisk0 = 1018773504flashDisk1 = 0numOfFlashDisks = 1EndGroup:flashDisksEndGroup:memoryBeginGroup:peripheralsmodem = noneWand_attached = noEndGroup:peripheralsBeginGroup:keypadKeypad_Type = NumericEndGroup:keypadBeginGroup:proximityReadersProximityReader_attached = noProxReaderFormat1 =默認 26位 FormatProximityReader_NumRecords = 2RemoteProx_attached = noRemoteProxFormat1 =默認 26位 FormatRemoteProx_NumRecords = 2EndGroup:proximityReadersEndGroup:hardwareBeginGroup:softwarerelease = 03.00.07.006

HTMLClientVersion = 5708model =克羅諾斯-4500OSversion = 5708bootVersion = 5708appVersion = 5708dbSchema = 5708Font_Information =默認 拉丁字體。 EndGroup:software
+0

您使用哪種編程語言?數據在哪裏存儲? –

+0

SQL。我從我們的時間和出勤計劃中獲得信息。希望這有助於...我不是一個技術人員。 –

+0

你必須更具體,否則你將無法在這裏得到很多幫助。 SQL在SQL Server中運行查詢/存儲過程?或者SQL簡單地檢索數據,它在VB.NET/C#程序中使用? –

回答

0

此答案假定使用VB.NET,並且還假定源字符串的結構不會更改。

'Variable to hold source data 
Dim sSource As String 

'*** perform code here to load source (from DB etc.) *** 

'separator array (change this as needed if sructure of the source sting changes) 
Dim sSep As String() = {"partNumber=", "serialNumber=", "EndGroup:boardBeginGroup:magnetic"} 

'split the source into Array 
Dim asSplit As String() = sSource.Split(sSep, StringSplitOptions.None) 

'get Part Number 
Dim sPartNumber As String = asSplit(1) 

'get Serial Number 
Dim sSerialNumber As String = asSplit(2) 
+0

我正在使用Visual Studio 2005編寫報告(而不是使用Crystal)並試圖弄清楚如何使用一個函數來解析出只有partNumber和serialNumber。我真的不明白使用Dim或輸入您提供的信息。對不起,我只是不太專業。 –

+0

我很抱歉,這是一個程序員問答板,您必須至少具有您使用的語言的基本知識。 –