Here is the code I wrote for batch replace with GB2312 encoding:-
var dir = new DirectoryInfo(@"D:\hgb");
string strFileName;
string content;
var encoding = Encoding.GetEncoding(936);
foreach (var f in dir.GetFiles("*.htm", SearchOption.AllDirectories))
{
strFileName = f.DirectoryName + @"\" + f.Name;
using (StreamReader reader = new StreamReader(strFileName, encoding))
{
content = reader.ReadToEnd();
content = Regex.Replace(content, "font size=-1", "font size=48");
}
StreamWriter writer = new StreamWriter(strFileName, false, encoding);
writer.Write(content);
writer.Close();
}
Software development tips, tricks and advice from NG Yew Ban, a professional Microsoft Certified Trainer and Microsoft Certified Solution Developer. BizTalk, ASP.NET, VB.NET, C#, Visual Basic, MS Access, MS SQL Server, Oracle, JavaScript, MS Office and more!
Saturday, July 09, 2011
Thursday, July 07, 2011
10175 Lab Correction (SharePoint 2010 Application Development)
General
Lab 2
Lab 4
Lab 8
Lab 10
- Trainer MOC page number may different with student page number.
Lab 2
- There are spacing issues in Exercise 3 Task 4 PowerShell Commands, All *SP Solution commands should be corrected as *SPSolution, e.g. Add-SP Solution should be corrected as Add-SPSolution.
- The -GAC Deployment should be corrected as -GACDeployment
Lab 4
- We should remove the where clause in unfilteredJobs LINQ query from Exercise 3 Task 5 Step 12 then only step 21 All Jobs will be displayed correctly.
- The web.config never changed although the lab works as expected, this issue is caused by access denied, we have to fix it in Powershell:
$svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$svc.RemoteAdministratorAccessDenied = $False
$svc.Update() - We should reference to System.Configuration to use the ConfigurationManager in Exercise 3 Task 2 Step 2.
- When you are instructed to input any object or variable name with spacing, please remove the space, example:- HR Training Management has to be input as HRTrainingManagement.
Lab 8
- There is a list "Mashup" is hidden, we can display it from SharePoint Designer All Files section.
Lab 10
- Please create a site page named Training for Exercise 2 Task 9 Step 3
- You may need to click the Share Documents few times to let the video thumbnails to display accordingly.
- The Microsoft Office is not activated in Hyper-V image and not able to perform Exercise 2 Task 1, workaround is to copy the Metro theme from C:\Program Files (x86)\Microsoft Office\Document Themes 14\Metro.thmx to Desktop
Subscribe to:
Posts (Atom)