有个硬件设备,定时向服务器的一个页面post数据,它提交数据的地址是/scada/gps?id=ident&gps=$GPRMC,020852.060,V,,,,,,,291006,,,N*4A这个目标原来可能使用java编写的,如果我要用.net来编写接收页面,可是它的页面是gps,没有扩展名,aspx是否能被这样的地址访问原始的提交数据是
POST /scada/gps?id=ident&gps=$GPRMC,020852.060,V,,,,,,,291006,,,N*4A HTTP/1.1
Host: 211.21.94.118
Content-Length: 0

解决方案 »

  1.   

    可以的 url 重写新群 DotNet Programmer 群号 112850311
    本群新开,欢迎dotnet程序员加入,我们致力于营造一个好的学习交流氛围,不管你是高手还是菜鸟,只要你虚心好学,我们都诚挚的欢迎您。
      

  2.   

    这不是传说的伪静态么。
    呵呵,可以解决的
    Web.Config
    system.web节点下
    <RewriterConfig>
        <Rules>
          <RewriterRule>
            <LookFor>~/scada/gps?id=([\s\S]*)</LookFor>
            <SendTo>~/default.aspx?id={0}</SendTo>
          </RewriterRule>
        </Rules>
      </RewriterConfig>
    <httpModules>
          <add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>
        </httpModules>
    configuration 节点下
      <configSections>
        <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
      </configSections>
      

  3.   

    这样你的连接就会重定向到你的default.aspx页面了
      

  4.   

    第一感觉就是使用 URL重写!
      

  5.   

    也可以重新写一个HttpModule 实现 System.Web.IHttpModule
      

  6.   

    哦,竟然能这样做,能不能
    <RewriterRule>
      <LookFor>~/scada/*.jsp</LookFor>
      <SendTo>~/*.aspx</SendTo>
      </RewriterRule>
      

  7.   

    楼上的,可以.
    但你需要在IIS中配置 .jsp扩展名映射到 asp.net处理.