首页 \ 问答 \ 来自php的.Net Web Service调用(.Net Web Service call from php)

来自php的.Net Web Service调用(.Net Web Service call from php)

如何在php中调用.Net Web服务。 php 4/5有什么有用的库吗?


How can I call a .Net Web Service from within php. Are there any useful libraries for php 4/5 ?


原文:https://stackoverflow.com/questions/1266488
更新时间:2021-03-11 07:03

最满意答案

请注意,Python的inin Fileinput的工作原理是将文件复制到备份文件,然后将输出重定向到原始文件。 所以它与你当前的方法没有什么不同,只是它使用临时文件而不是将其加载到内存中。 将其加载到内存中可能没问题,除非文件非常大。

如果文件很大,我建议将其复制到临时目录,然后使用bufio包中的函数bufio读取,修改所需内容并将结果写入与原始文件同名的新文件。


Note that Python's inplace Fileinput works by copying the file to backup file and then redirecting the output to the original file. So it's not all that different from your current approach except that it uses a temporary file instead of loading it in memory. Loading it in memory could be ok, unless the file is very large.

If the file is large, I suggest copying it to a temporary directory and then use the functions from the bufio package to read it line by line, modify what's needed and write the result to a new file with the same name as the original.

相关问答

更多
  • 使用vi再次打开文件。 然后按插入按钮开始编辑它。 Open the file again using vi. and then press the insert button to begin editing it.
  • 如果你是* nix(并且假设你只需要修改文件的一部分(很少)),你可以拆分文件(使用split命令),单独编辑它们(使用awk , sed或类似的东西)并连接他们完成后 cat file2 file3 >> file1 If you are on *nix (and assuming you have to modify only parts of file (and rarely)), you may split the files (using the split command), edit the ...
  • 手头有两个即时问题 首先,需要读取文件,以便可以逐步更新UI而不会造成无法接受的延迟 其次, JTextArea能够实际处理这些数据量...... 第一个问题相对而言很容易解决。 您需要确保的是,在您读取文件时并未阻止事件派发线程,并且您只是在事件派发线程的上下文中更新JTextArea 。 为此, SwingWorker是一个很好的选择,例如... public class FileReaderWorker extends SwingWorker, String> { ...
  • 对500MB文件进行split可能不是一个好主意。 您可以编写自己的解析器来处理文件,但它可能不是很快: private function fileComplete(p_evt:Event):void { var array:Array = []; var char:String; var line:String = ""; while(stream.position < stream.bytesAvailable) { char = stream ...
  • 在我的原始小提琴中有一些额外的Controller标签。 现在它起作用 - 这是更新的小提琴。 http://jsfiddle.net/cguy/wcMzw/9/

    Here we repeat the contacts to ensure bindings work