Re: [问题] 写好的程式,不能在别台电脑使用

楼主: SLS530 (。)   2014-06-21 14:17:29
※ 引述《puper (Oh Yes)》之铭言:
: 在测试的电脑已有装.net framework
: 看看图片
: http://i.imgur.com/rRsEP.jpg
: 能装的应该都装了,请问还差什么,才能够在其他台电脑正常执行?
我也遇到类似的状况
两台电脑都是 Windows 7 64bit
其中一台有装 Visual Studio Express 2013 来写C#,程式可以正常执行
另一台有装 .NET Framework 4.5.1 (离线安装),程式无法执行
不管是发行专案、Debug、Release,都一样会出现“已经停止运作”
程式码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
int championsnum = 0;
string[] champions = { "Aatrox",
"Ahri",
"Akali",
"Alistar",
"Amumu",
"Anivia",
"Annie",
"Ashe",
"Blitzcrank",
"Brand",
"Braum",
"Caitlyn",
"Cassiopeia",
"Chogath",
"Corki",
"Darius",
"Diana",
"Draven",
"DrMundo",
"Elise",
"Evelynn",
"Ezreal",
"Fiddlesticks",
"Fiora",
"Fizz",
"Galio",
"Gangplank",
"Garen",
"Gragas",
"Graves",
"Hecarim",
"Heimerdinger",
"Irelia",
"Janna",
"JarvanIV",
"Jax",
"Jayce",
"Jinx",
"Karma",
"Karthus",
"Kassadin",
"Katarina",
"Kayle",
"Kennen",
"KhaZix",
"KogMaw",
"LeBlanc",
"LeeSin",
"Leona",
"Lissandra",
"Lucian",
"Lulu",
"Lux",
"Malphite",
"Malzahar",
"Maokai",
"MasterYi",
"MissFortune",
"MonkeyKing",
"Mordekaiser",
"Morgana",
"Nami",
"Nasus",
"Nautilus",
"Nidalee",
"Nocturne",
"Nunu",
"Olaf",
"Orianna",
"Pantheon",
"Poppy",
"Quinn",
"Rammus",
"Renekton",
"Rengar",
"Riven",
"Rumble",
"Ryze",
"Sejuani",
"Shaco",
"Shen",
"Shyvana",
"Singed",
"Sion",
"Sivir",
"Skarner",
"Sona",
"Soraka",
"Swain",
"Syndra",
"Talon",
"Taric",
"Teemo",
"Thresh",
"Tristana",
"Trundle",
"Tryndamere",
"TwistedFate",
"Twitch",
"Udyr",
"Urgot",
"Varus",
"Vayne",
"Veigar",
"VelKoz",
"Vi",
"Viktor",
"Vladimir",
"Volibear",
"Warwick",
"Xerath",
"XinZhao",
"Yasuo",
"Yorick",
"Zac",
"Zed",
"Ziggs",
"Zilean",
"Zyra"
};
int[] skinnummax = { 1, //Aatrox
4, //Ahri
6, //Akali
6, //Alistar
7, //Amumu
5, //Anivia
8, //Annie
6, //Ashe
7, //Blitzcrank
4, //Brand
1, //Braum
5, //Caitlyn
4, //Cassiopeia
5, //Chogath
6, //Corki
3, //Darius
2, //Diana
2, //Draven
7, //DrMundo",
2, //Elise",
3, //Evelynn",
6, //Ezreal",
7, //Fiddlesticks",
3, //Fiora",
4, //Fizz",
4, //Galio",
5, //Gangplank",
6, //Garen",
6, //Gragas",
5, //Graves",
4, //Hecarim",
4, //Heimerdinger",
4, //Irelia",
5, //Janna",
5, //JarvanIV",
8, //Jax",
2, //Jayce",
1, //Jinx",
3, //Karma",
4, //Karthus",
4, //Kassadin",
7, //Katarina",
6, //Kayle",
5, //Kennen",
1, //KhaZix",
7, //KogMaw",
3, //LeBlanc",
6, //LeeSin",
4, //Leona",
2, //Lissandra",
1, //Lucian",
4, //Lulu",
5, //Lux",
5, //Malphite",
4, //Malzahar",
4, //Maokai",
5, //MasterYi",
6, //MissFortune",
3, //MonkeyKing",
4, //Mordekaiser",
5, //Morgana",
2, //Nami",
5, //Nasus",
3, //Nautilus",
6, //Nidalee",
5, //Nocturne",
6, //Nunu",
4, //Olaf",
4, //Orianna",
6, //Pantheon",
6, //Poppy",
2, //Quinn",
6, //Rammus",
5, //Renekton",
2, //Rengar",
5, //Riven",
3, //Rumble",
9, //Ryze",
4, //Sejuani",
6, //Shaco",
6, //Shen",
4, //Shyvana",
6, //Singed",
4, //Sion",
6, //Sivir",
2, //Skarner",
5, //Sona",
3, //Soraka",
3, //Swain",
2, //Syndra",
3, //Talon",
3, //Taric",
7, //Teemo",
2, //Thresh",
6, //Tristana",
3, //Trundle",
6, //Tryndamere",
7, //TwistedFate",
5, //Twitch",
3, //Udyr",
3, //Urgot",
3, //Varus",
5, //Vayne",
7, //Veigar",
1, //VelKoz",
2, //Vi",
3, //Viktor",
5, //Vladimir",
3, //Volibear",
7, //Warwick",
3, //Xerath",
5, //XinZhao",
1, //Yasuo",
2, //Yorick",
1, //Zac",
2, //Zed",
4, //Ziggs",
4, //Zilean",
3, //Zyra",
};
int skinnum = 0;
public Form1()
{
InitializeComponent();
label1.Text = champions[championsnum];
label2.Text = "Skin编号:" + championsnum;
Image pic = Image.FromFile(@"C:\LoLSkin\\" +
champions[championsnum] + "_" + skinnum + ".jpg");
this.pictureBox1.BackgroundImage = pic;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
string championskin;
championskin = champions[championsnum] + "=" + skinnum;
for (int i = 0; i < skinnummax[championsnum]+1; i++)
{
string str;
using (StreamReader sr = new StreamReader("C:\\Program Files
(x86)\\GarenaLoLTW\\GameData\\Apps\\LoLTW\\Game\\skinID.ini"))
{
str = sr.ReadToEnd();
}
str = str.Replace(champions[championsnum] + "=" + i,
championskin);
using (StreamWriter sw = new StreamWriter("C:\\Program Files
(x86)\\GarenaLoLTW\\GameData\\Apps\\LoLTW\\Game\\skinID.ini"))
{
sw.Write(str);
}
}
label3.Text = "已套用";
}
private void button2_Click(object sender, EventArgs e)
{
if (championsnum == 0)
{
championsnum = champions.Length -1 ;
}
else {
championsnum = championsnum - 1;
}
label1.Text = champions[championsnum];
skinnum = 0;
Image pic = Image.FromFile(@"C:\LoLSkin\\" +
champions[championsnum] + "_" + skinnum + ".jpg");
this.pictureBox1.BackgroundImage = pic;
label2.Text = "Skin编号:0";
label3.Text = "";
}
private void button3_Click(object sender, EventArgs e)
{
if (championsnum == champions.Length -1 )
{
championsnum = 0;
}
else
{
championsnum = championsnum + 1;
}
label1.Text = champions[championsnum];
skinnum = 0;
Image pic = Image.FromFile(@"C:\LoLSkin\\" +
champions[championsnum] + "_" + skinnum + ".jpg");
this.pictureBox1.BackgroundImage = pic;
label2.Text = "Skin编号:0";
label3.Text = "";
}
private void button5_Click(object sender, EventArgs e)
{
if (skinnum == 0)
{
skinnum = skinnummax[championsnum];
}
else
{
skinnum = skinnum - 1;
}
Image pic = Image.FromFile(@"C:\LoLSkin\\" +
champions[championsnum] + "_" + skinnum + ".jpg");
this.pictureBox1.BackgroundImage = pic;
label2.Text = "Skin编号:" + skinnum;
label3.Text = "";
}
private void button4_Click(object sender, EventArgs e)
{
if (skinnum == skinnummax[championsnum])
{
skinnum = 0;
}
else
{
skinnum = skinnum + 1;
}
Image pic = Image.FromFile(@"C:\LoLSkin\\" +
champions[championsnum] + "_" + skinnum + ".jpg");
this.pictureBox1.BackgroundImage = pic;
label2.Text = "Skin编号:" + skinnum;
label3.Text = "";
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}
作者: neo5277 (I am an agent of chaos)   2014-06-21 16:09:00
2013是不是一定要8.1才可以装?
作者: GoalBased (Artificail Intelligence)   2014-06-21 16:21:00
给楼上,应该不是吧 我们server也有装2013
作者: neo5277 (I am an agent of chaos)   2014-06-21 16:26:00
喔喔好喔 那我来试看看 书是2013 我之前都是装2010..TKS
作者: GoalBased (Artificail Intelligence)   2014-06-21 16:50:00
去官网看一下有没有限制就好了 还要装多麻烦@@

Links booklink

Contact Us: admin [ a t ] ucptt.com