最新评论
dandanlife 2012-05-18 17:21
楼主,你好,借鉴了你的加密/解密的方法
对于比较短的字符串可以实现加密/解密的功能,但是如果是比较大的字符串,加密时没有有问题,可是解密时会出现如下的异常:
Length of the data to decrypt is invalid
找了许久也没找到原因,楼主是否可以帮帮我解决这个问题
原始串:
metadata=res://*/DataStore.csdl|res://*/DataStore.ssdl|res://*/DataStore.msl;provider=System.Data.SqlClient;provider connection string="Data Source=127.0.0.1;Initial Catalog=CryptoDataTest;Persist Security Info=True;User ID=sa;Password=123456789;MultipleActiveResultSets=True"
加密后的串:
nTC5OPoiV+jVUZWp1pdIWMWLCBvOpzzxa/JmwIj0dH+jo3F5IfFSNuZxuyd6rmoW73JEN+mXRGuxBFMPZXPXGgsEzurdH6JAH4tm8YePygJ5V17AyfPanhN7WfXLHNfL9ZwC0NBz8vJkgbUmpnTewHEIYKyEh14ufAsLE/IBuYWXtGzXbJmGl9IWpMR7rPOMHUSwTDuw/FZHPuCvEVjSUbBBAzri4GcbcaRsep128NIkOZt2mc+2PdQ/nb3KPQ9csbOdARioLviArnTu+HHsZK7Xr0dsU/XvTrHLFdJVW4ELYPKRTzz5i6zIjEki6o+j9v23rqxRFqbsjk3aYwwXAfjsF0QRk3UE0SuaW8WkA3TfY48daryxhbBTsG6BfzogufLzpWxQEXckDRE4KEiuhUxqUDsyD1pujGDcSpp1UqWKevu9mVkBZEacaOMdi7daPZvgk2bSRY2Vxy0KChJP/mf1sFmgiakgiWQjHNIc06qCTSIUXJIhaw7tbCwm3vau0UZqOPQoVRL9uJAAGGcu/qH2NtJ/HemT6KtmOue4ahu
然后拿加密后的串再进行解密就会出现如上所示的异常:
Length of the data to decrypt is invalid
或Invalid length for a Base-64 char array
霹雳猪猪 2012-04-25 10:48
@枫亭幽竹
我使用的方式也是在APP.XAML 中使用ResorceDicTionary方式,同样出现了编译不正常
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="UI/Theme.xaml"/>
<ResourceDictionary Source="UI/Win8/Colors.xaml"/>
<ResourceDictionary Source="UI/Win8/Fonts.xaml"/>
<ResourceDictionary Source="UI/Win8/ResourceDictionary1.xaml"/>
<ResourceDictionary Source="UI/Win8/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
liuchangfei 2012-03-29 19:31
亲问一下,怎么放进图片的呢????? <Image Source="Resoures/images/a.png" Width="32" Height="32" /> 我电脑上不显示呢
davez 2012-03-24 18:45
@好高务远
你可能是在使用之前没有将引入名称空间吧!在Title前面添加xmlns:c="clr-namespace:System;assembly=mscorlib"试一下吧!
好高务远 2012-03-22 11:47
我是初学者
<c:String x:Key="strMessage">My String Value.</c:String>我这句报错
““c”是未声明的前缀。 第 7 行,位置 14。.”XML 无效。
谢谢能告诉我是什么原因吗
半夏鸣蝉 2012-01-09 11:23
- -楼主,请教个问题,为啥F5跟Ctrl F5.不出来东西呢[code=csharp]
<Window x:Class="WpfTest.Window3"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window3" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60" Style="BackGround:Black" />
<RowDefinition Height="202*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Grid.Row="0" Height="30" VerticalAlignment="Top" Content="LeftTop1"></Button>
<Button Grid.Column="0" Grid.Row="0" Height="30" VerticalAlignment="Bottom" Content="LeftDown1"></Button>
<Button Grid.Column="1" Grid.Row="0" Content="RightTop"></Button>
<Button Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Content="aaaaa"></Button>
</Grid>
</Window>
[/code]
残阳掠影 2011-11-25 11:06
和楼主有同感,小弟这几月也很纠结,发现要学的东西实在是多的让人无奈,WPF、WCF、WF、Silverlight、JQuery、Ajax、ASP.Net MVC、ADO.Net Entry…
除了WF,其他几个也是这段时间频繁出现在视野中的东西。
悲叹之余,发现程序员这条路还真是不好走。
