C# Errors

Joined
Feb 4, 2009
Messages
1
Reaction score
0
I really don't know too much about C# and I need help right now.

The errors are
Error 1 Cannot implicitly convert type 'string' to 'int'
Error 2 An object reference is required for the non-static field, method, or property 'WzLib.WzFile.SaveToDisk(string)'
Error 3 An object reference is required for the non-static field, method, or property 'WzLib.WzFile.GetObjectsFromWildcardPath(string)'

Heres the scripting.

using WzLib;
using ManagedZLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WzRepacker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void SaveStats_Click(object sender, EventArgs e)
{
int Path = ("C:\\Nexon\\Maplestory"); Error 1 here
WzFile.SaveToDisk("C:\\Nexon\\Maplestory"); Error 2 here
}

private void SaveGraphics_Click(object sender, EventArgs e)
{
foreach (WzSubProperty info in WzFile.GetObjectsFromWildcardPath("Mob.wz/*.img/info")) info.AddProperty(new WzCompressedIntProperty("notAttack", 1)); Error 3 here
}
}
}
 
Joined
Jun 30, 2009
Messages
10
Reaction score
0
You really should start with something easier...

First:
int Path = ("C:\\Nexon\\Maplestory"); Error 1 here

An INT can keep one number. INTeger as in 1 2 3 etc.
A CHAR can store a CHARacter. a b c d ect.
A STRING can store an array of Chars. 'abcd'.

You are saying you want your int to store something that is not a number. You're trying to store a string inside a int. I really advise you to go and make some char turorials. there are many on the internet..

As for the other errors:

In c# you have to declare functions before you use them. If you use a DLL [aka windows] function you must declare it. Do some tutorials to learn the basics
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top