我想添加到一个文本文件中(带有绝对路径)许多字符串(一个在另一个下面)。我认为我已经通过这个例子找到了解决方案:
echo hello & echo.world但是当我去运行我的程序时,程序只向文本文件添加最后一个字符串(即# 127.0.0.1 spclient.wg.spotify.com)。
有人知道解决办法吗?
我的蝙蝠密码:
echo 127.0.0.1 media-match.com & echo.127.0.0.1 adclick.g.doublecklick.net & echo.127.0.0.1 www.googleadservices.com & echo.127.0.0.1 media-match.com & echo.127.0.0.1 adclick.g.doublecklick.net & echo.127.0.0.1 www.googleadservices.com & echo.127.0.0.1 pagead2.googlesyndication.com & echo.127.0.0.1 googleads.g.doubleclick.net & echo.127.0.0.1 pubads.g.doubleclick.net & echo.127.0.0.1 securepubads.g.doubleclick.net & echo.127.0.0.1 www.omaze.com & echo.127.0.0.1 omaze.com & echo.127.0.0.1 bounceexchange.com & echo.127.0.0.1 core.insightexpressai.com & echo.127.0.0.1 content.bitsontherun.com & echo.127.0.0.1 s0.2mdn.net & echo.127.0.0.1 v.jwpcdn.com & echo.127.0.0.1 d2gi7ultltnc2u.cloudfront.net & echo.127.0.0.1 cs283.wpc.teliasoneracdn.net & echo.127.0.0.1 cs126.wpc.teliasoneracdn.net & echo.127.0.0.1 u.scdn.co & echo.127.0.0.1 cs126.wpc.edgecastcdn.net & echo.127.0.0.1 pagead46.l.doubleclick.net & echo.127.0.0.1 pagead.l.doubleclick.net & echo.127.0.0.1 video-ad-stats.googlesyndication.com & echo.127.0.0.1 pagead-googlehosted.l.google.com & echo.127.0.0.1 partnerad.l.doubleclick.net & echo.127.0.0.1 prod.spotify.map.fastlylb.net & echo.127.0.0.1 adserver.adtechus.com & echo.127.0.0.1 na.gmtdmp.com & echo.127.0.0.1 anycast.pixel.adsafeprotected.com & echo.127.0.0.1 ads.pubmatic.com & echo.127.0.0.1 idsync-ext.rlcdn.com & echo.127.0.0.1 www.googletagservices.com & echo.127.0.0.1 googlehosted.l.googleusercontent.com & echo.127.0.0.1 d361oi6ppvq2ym.cloudfront.net & echo.127.0.0.1 gads.pubmatic.com & echo.127.0.0.1 ads-west-colo.adsymptotic.com & echo.127.0.0.1 geo3.ggpht.com & echo.127.0.0.1 showads33000.pubmatic.com & echo.127.0.0.1 crashdump.spotify.com & echo.127.0.0.1 adeventtracker.spotify.com & echo.127.0.0.1 log.spotify.com & echo.127.0.0.1 analytics.spotify.com & echo.127.0.0.1 ads-fa.spotify.com & echo.127.0.0.1 audio-ec.spotify.com & echo.127.0.0.1 sto3.spotify.com & echo.127.0.0.1 audio2.spotify.com & echo.127.0.0.1 http://audio2.spotify.com & echo.127.0.0.1 www.audio2.spotify.com & echo.127.0.0.1 desktop.spotify.com & echo.127.0.0.1 heads-ec.spotify.com & echo.127.0.0.1 open.spotify.com & echo.#127.0.0.1 spclient.wg.spotify.com >> C:\Users\utente\Documents\bersaglio.txt我用我用c #编写的程序生成了代码,这是代码:
**using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
String n = "\\n", n2;
String finale = "";
Console.WriteLine("This little program is used to insert '& echo.'between 2 or more output strings \n \n \nHow many strings do you have?");
int stringhe = Convert.ToInt16(Console.ReadLine());
for (int i = 0; i < stringhe; i++)
{
Console.Clear();
Console.WriteLine("enter string number " + (i + 1));
n = Console.ReadLine();
finale = finale +" & echo." + n;
}
Console.WriteLine(finale);
String terminadebug = Console.ReadLine();
}
}
}**发布于 2020-11-05 22:18:51
echo.很有用,因为在语法上使用标记(就像两个空格)是很好的。因此,如果您想在脚本中使用"hello world“,那么简单地说:
(
echo. The dolphins in the Australia are pretty cool, they eats cups
echo and a lot of fish. They are "fishes"! Haha.
echo I promise that the weed is still there, I don't use that things.
echo end
) >> "file.txt"">>“是”写在.“,如果您想替换所有的">”就像“写和替换”,这将替换文本上的所有内容。
如果您想在之后读取第二行文本文件,使用批处理脚本,我将很乐意帮助您。
https://stackoverflow.com/questions/64578524
复制相似问题