我收到一个错误,很遗憾地说我对处理 64base 字符串知之甚少。目前我已经将此错误追溯到这行代码:
byte[] jobData = Convert.FromBase64String(base64JobData);
这是我的 XML,它被传递到 base64JobData 但我似乎找不到任何应该引发此错误的东西。
<?xml version="1.0" encoding="utf-16"?>
<JobItem xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SiteServerItemShareCollection" JobName="0005_Hi" JobTargetResultId="2a59cf11-c58e-4cdc-80e8-7b4c70b940dc" JobId="5a79a30f-3250-4401-b181-f6e5f16fe5ef" JobItemType="NetworkShare" JobProcessWorkflowId="9834e3a5-b508-405f-ad5b-d8c9d1837982" Priority="1" CallbackConversationId="fb501b7b-cd43-4883-bbc7-5a356e1dd030" IsAudit="false" IsRemediation="false" IsArchive="true" IsPreview="false" ReportOnNonResponsiveData="false" CustodianId="00000000-0000-0000-0000-000000000000" IsCompleted="false" HasCredentials="true" MinSecondsBetweenAttempts="600" UseRedirectedAcquisition="false" IsSerialProcessing="false" CanPhoneHome="false" AgentGuid="00000000-0000-0000-0000-000000000000" DynamicIPLocality="false" TaskId="00000000-0000-0000-0000-000000000000">
<CollectionItemQueue ItemId="2a59cf11-c58e-4cdc-80e8-7b4c70b940dc" CollectionId="5a79a30f-3250-4401-b181-f6e5f16fe5ef" CollectionType="NetworkShare" Name="0005_Hi" ReferenceItemId="00000000-0000-0000-0000-000000000000" CollectionStatus="0">
<AssetCollectionStartDate xsi:nil="true" />
<PrescanStartDate xsi:nil="true" />
<LastCollectedFileSize xsi:nil="true" />
<NumberFilesCollected xsi:nil="true" />
<FilesCollectedSize xsi:nil="true" />
<CurrentFileSize xsi:nil="true" />
<TotalPossibleFilesToCollect xsi:nil="true" />
<TotalPossibleFileBytesToCollect xsi:nil="true" />
</CollectionItemQueue>
<RunCollectionPreScan>false</RunCollectionPreScan>
<FileTransferRetryDelayInSeconds>900</FileTransferRetryDelayInSeconds>
<FileTransferRetryAttempts>3</FileTransferRetryAttempts>
<AssetCollectionStartDate xsi:nil="true" />
<PrescanStartDate xsi:nil="true" />
<LastCollectedFileSize xsi:nil="true" />
<NumberFilesCollected xsi:nil="true" />
<FilesCollectedSize xsi:nil="true" />
<CurrentFileSize xsi:nil="true" />
<TotalPossibleFilesToCollect xsi:nil="true" />
<TotalPossibleFileBytesToCollect xsi:nil="true" />
<JobTargetName>\\10.10.200.222\Evidence</JobTargetName>
<JobTargetId>fd0d6e98-7227-4589-b578-a8f0a88955c2</JobTargetId>
<JobResultId>00000000-0000-0000-0000-000000000000</JobResultId>
<FiltersXML><Filter SystemFiles="false" UnusedDiskArea="false" VolumeSlack="false" CollectArchiveContentOnly="true" CollectEncryptedFiles="false" UsePhysicalDrives="false" UseSearchWithAgent="false" UseSearchWithServer="false" AutoDrillDown="false" CollectNoExtensionFiles="false" IncludeDeletedFiles="false" SmartFileIdentification="false" xmlns="http://FilterSchema" /></FiltersXML>
<ResponsiveFilePath>\\10.10.200.222\E$\Cases\Jobs\Test\2013-01-30 15.46.46\Item_10.10.200.222Evidence\1</ResponsiveFilePath>
<CollectionAttemptBeginTime xsi:nil="true" />
<CollectionAttemptEndTime xsi:nil="true" />
<CollectAsCredentials />
<Expiration>2013-03-01T15:46:45.797</Expiration>
<CollectionEncryption>
<CollectionId>5a79a30f-3250-4401-b181-f6e5f16fe5ef</CollectionId>
<EncryptionType>None</EncryptionType>
<CertificateId>00000000-0000-0000-0000-000000000000</CertificateId>
</CollectionEncryption>
</JobItem>
有没有一种简单的方法可以找出这个 xml 字符串中的违规字符是什么?或可以帮助我找到失败原因的工具。