2
WP7에서 상대 URI 경로를 사용하여 이미지를 표시하는 것이 간단합니다. 그러나 텍스트 파일을로드하는 것은 큰 의문이됩니다.WP7에서 텍스트 파일을로드하는 URI는 무엇입니까?
이미지를보고 URI가 파일을 문자열 변수로 사용하는 모양을 알려주십시오.
Dim S As String
Dim U As New Uri("file:///Family_christmas;component/database/de/1.txt", UriKind.Absolute)
Dim sr As New IO.StreamReader(U.LocalPath, System.Text.Encoding.Unicode)
S = sr.ReadToEnd
sr.Close()
Me.Title = S.Split(Environment.NewLine)(0)
Me.Text = S.Substring(Me.Title.Length + Environment.NewLine.Length)
* 그 방법 *
선언 파일 ressource로하지 내용 등을 해결했다. 그런 다음, 다음 코드를 사용 : 기본적 StreamReader
으로
Dim S As String
Dim U As New Uri("database/de/1.txt", UriKind.Relative)
Dim streamInfo As Windows.Resources.StreamResourceInfo = Application.GetResourceStream(U)
Dim sr As New IO.StreamReader(streamInfo.Stream, System.Text.Encoding.Unicode)
S = sr.ReadToEnd
sr.Close()
빠른 답장을 보내 주셔서 감사합니다. 너는 내 하루를 보냈다! – Nasenbaer