VBScript에서 GetBytes (System.Text.UTF8Encoding)를 어떻게 호출합니까?System.Text.UTF8Encoding From VBScript
너 can use the .NET Framework from VBScript을 its exposed to COM으로 설정했지만 좋은 설명서/매뉴얼을 찾지 못했습니다.
VBScript에서 GetBytes (System.Text.UTF8Encoding)를 어떻게 호출합니까?System.Text.UTF8Encoding From VBScript
너 can use the .NET Framework from VBScript을 its exposed to COM으로 설정했지만 좋은 설명서/매뉴얼을 찾지 못했습니다.
당신이 VBScript로 상당을 찾고 있다면, 당신은 아도 스트림을 사용하여 수행 할 수 있습니다
Const adTypeBinary = 1
Dim adoStr, bytesthroughado
Set adoStr = CreateObject("Adodb.Stream")
adoStr.Charset = "utf-8"
adoStr.Open
adoStr.WriteText "你好Ğ"
adoStr.Position = 0 'reset position
adoStr.Type = adTypeBinary
adoStr.Position = 3 'skip bom
bytesthroughado = adoStr.Read 'get bytes
WScript.Echo LenB(bytesthroughado) 'length
adoStr.Close
Set adoStr = Nothing
그것은에서 VBScript (mscorlib에에서) 일부 닷넷 구성 요소에 액세스 할 수 있습니다.
Dim encoding, bytesthroughdotnet
Set encoding = CreateObject("System.Text.UTF8Encoding")
bytesthroughdotnet = encoding.GetBytes_4("你好Ğ") 'get bytes
WScript.Echo LenB(bytesthroughdotnet) 'length
Set encoding = Nothing
GetBytes_4에서 "_4"를 사용하는 것을 어떻게 알고 있습니까? – Eugene
@ user389823 적절한 방법을 찾을 때까지 접미어를 늘립니다. 불행히도 접미사의 순서는 .Net 오버로드 목록과 일치하지 않습니다. 누군가가 정말로 알고 있는지 듣고 싶습니다. –
http://stackoverflow.com/questions/9755263/determining-net-method-suffix-number-in-vbscript-com에서 질문을했습니다. 다시 한 번 감사드립니다. (원래는 _3까지만 올라갔습니다)! – Eugene
시간 시대 착오, 공룡 및 인간의 영화 스타일. [ComVisible] 클래스를 작성하여 타임머신을 다시 설정할 수 있습니다. –