0

悲しいことに、64base 文字列の処理についてあまり知らないというエラーが表示されます。現在、このエラーを次のコード行まで追跡しました。

byte[] jobData = Convert.FromBase64String(base64JobData);

これがbase64JobDataに渡されている私のXMLですが、このエラーをスローする必要があるものを見つけることができないようです。

<?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>&lt;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" /&gt;</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 文字列に問題のある文字が何であるかを簡単に把握する方法はありますか? または、この失敗の原因を見つけるのに役立つツール。

4

1 に答える 1

0

あなたの質問が紛らわしいか、関数の動作を誤解していると思います。この関数は FROM base64 に変換するためのものであるため、上記の XML を入力すると機能しません。この関数は、base64 でエンコードされた文字列を想定しています。

これはMSからのリンクです-frombase64string

これは、「バイナリ データを base-64 数字としてエンコードする指定された文字列を、同等の 8 ビット符号なし整数配列に変換する」と述べています。

パラメータ文字列 "s" - s は、base-64 の数字、空白文字、および末尾の埋め込み文字で構成されます。base-64 の数字は、0 から昇順で、大文字の "A" から "Z"、小文字の "a" から "z"、数字の "0" から "9"、および記号の "+" と "/" です。 "。

于 2013-01-31T01:23:04.183 に答える