我想从用户那里取五个名字,并在一个文本文件中收集它们,写下来:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="HelloService.HelloService" behaviorConfiguration="mexBehaviour">
<endpoint address="HelloService" contract="HelloService.IHelloService" binding="basicHttpBinding"></endpoint>
<endpoint address="HelloService" contract="HelloService.IHelloService" binding="netTcpBinding"></endpoint>
<endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding"></endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8081/"/>
<add baseAddress="net.tcp://localhost:8090/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehaviour">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
它给了我一个错误。说&#34;找不到符号&#34;在第9行。为什么??
答案 0 :(得分:7)
你需要为String数组调用new,如下所示
String[] names= new String[5];