import clrimport Systemclr.AddReferenceToFile("SimpleHash.dll")from Common import *class HashPy(SimpleHash): def __init__(self): pass def HashCalc(self,arg1,arg2): #str to byte[] arg1=System.Text.Encoding.Default.GetBytes(arg1) arg2=System.Text.Encoding.Default.GetBytes(arg2) return SimpleHash.HashCalc(self,arg1,arg2)audiobuff="1234567812345678123456781234567812345678123456781234567812345678S456781234567812345678123456781234567812345678123456781234567812345678S456781234567812345678123456781234567812345678123456781234567812345678S4567812345678123456781234567812345678123456781234567812345678"key="12345678"print HashPy().HashCalc(audiobuff,key);python ctype只能呼叫c/c++. 你要呼叫c#的dll 要用IronPython。如上面的例子
import clrimport Systemclr.AddReferenceToFile("SimpleHash.dll")from Common import *class HashPy(SimpleHash): def __init__(self): pass def HashCalc(self,arg1,arg2): #str to byte[] arg1=System.Text.Encoding.Default.GetBytes(arg1) arg2=System.Text.Encoding.Default.GetBytes(arg2) return SimpleHash.HashCalc(self,arg1,arg2)audiobuff="1234567812345678123456781234567812345678123456781234567812345678S456781234567812345678123456781234567812345678123456781234567812345678S456781234567812345678123456781234567812345678123456781234567812345678S4567812345678123456781234567812345678123456781234567812345678"key="12345678"print HashPy().HashCalc(audiobuff,key);python ctype只能呼叫c/c++. 你要呼叫c#的dll 要用IronPython。如上面的例子