جۇغلانما 862  
 UID 6406  
 
تىزىملاتقان 2012-2-11 
 
ئاخىرقى قېتىم 2015-4-7 
 
توردا 129 سائەت 
 
 
ئالىي ئەزا 
نادىر 0 
	جۇغلانما 862  
ئاقچا 5  
 
 
 
 
	
     
 
 
    x:Class="WindowsPhoneApplication1.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 
    xmlns:browser="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    FontFamily="{StaticResource PhoneFontFamilyNormal}" 
    FontSize="{StaticResource PhoneFontSizeNormal}" 
    Foreground="{StaticResource PhoneForegroundBrush}" 
    SupportedOrientations="Portrait" Orientation="Portrait" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    shell:SystemTray.IsVisible="True"> 
     
         
             
             
         
         
             
         
         
             
             
             
             
             
         
     
         
 
ئىككىنجى : 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Net; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Animation; 
using System.Windows.Shapes; 
using Microsoft.Phone.Controls; 
using System.IO.IsolatedStorage; 
using System.Windows.Resources; 
using System.IO; 
 
namespace WindowsPhoneApplication1 
{ 
    public partial class MainPage : PhoneApplicationPage 
    { 
        public MainPage() 
        { 
            InitializeComponent(); 
        } 
        private void button1_Click(object sender, RoutedEventArgs e) 
        { 
          webBrowser1.Navigate(new Uri(textBox1.Text, UriKind.Absolute));//在控件中打开网页 
        } 
        private void SaveStringToIsoStore(string strWebContent) 
        { 
            IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();//获取本地应用程序存储对象 
 
            //清除之前保存的网页 
            if (isoStore.FileExists("web.htm") == true) 
            { 
                isoStore.DeleteFile("web.htm"); 
            } 
            StreamResourceInfo sr = new StreamResourceInfo(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(strWebContent)), "html/text");//转化为流 
            using (BinaryReader br = new BinaryReader(sr.Stream)) 
            { 
                byte[] data = br.ReadBytes((int)sr.Stream.Length); 
                //保存文件到本地存储 
                using (BinaryWriter bw = new BinaryWriter(isoStore.CreateFile("web.htm"))) 
                { 
                    bw.Write(data); 
                    bw.Close(); 
                } 
            } 
        } 
        private void btnSave_Click(object sender, RoutedEventArgs e) 
        { 
            string strWebContent = webBrowser1.SaveToString();//获取网页的html代码 
            SaveStringToIsoStore(strWebContent); 
        } 
 
        private void btnLoad_Click(object sender, RoutedEventArgs e) 
        { 
            webBrowser1.Navigate(new Uri("web.htm", UriKind.Relative));//加载本地保存的页面 
        } 
    } 
} بۇ يازمىنى ئاخىرىدا   qoglan2 تەھرىرلىگەن. ۋاقتى  2012-3-18 14:36