|
nothing changed
when I tried to install, service all times give this error:
error 1001:the apperred system is still there.
|
|
|
|
|
hmm.. that's odd. Could you make sure that your service is uninstalled when you run your "new" MSI (the one generated with the code I added), then make an install, change the version number (and upgrade code) and then perform an upgrade?
|
|
|
|
|
Hi Everyone
I am writing an Excel document in C#. I am writing it in 'Visual Studio 2008' and the project type is a '2007 Excel Workbook'. I was able to add all the controls and functionality I want to the Excel Workbook and it works. The problem is when I try to 'compile' (not sure if compile is the right word) the Excel document, it's dependent on a bunch of other files.
for example the resulting ExcelWorkbook2.xlsx file is dependent on a bunch of other files like:
ExcelWorkbook2.vsto
ExcelWorkbook2.dll
ExcelWorkbook2.dll.manifest
Is there a way to embed these files into the xlsx file so that the ExcelWorkbook2.xlsx will work on it's own?
I am writing this for some corporate people in my company and I think they'll have a hard time to remember to copy all these dependent files along with the Excel Workbook. So it would be nice to have everything in one file. I could probably write VBA Macros instead, but it would be nice to do it in C#.
Any help is appreciated
Regards
KOM UIT DAAAAA!!!
|
|
|
|
|
Ncb files are used for intellisense in C++ projects - at least that's the information I found in the web. Now I have a solution containing some 20 C# projects and one (1) C++ project, the main project being a C# project.
Before opening the solution (in Visual Studio 2005 Professional), I deleted the ncb file found in that project's directory. After closing the solution, an ncb file (with more than the size of all dlls and pdbs summed up) resides there.
Since the project is a C# project, I think that file is pretty useless, isn't it? How can I safely get rid of it?
By the way, I tried the tricks to be found by Google for C++ projects, they did not help here.
|
|
|
|
|
Did you try this:
Rename the file (VS root path)\VC\vcpackages\feacp.dll, then delete the .ncb file and now it should not be created again.
I am a HUMAN. I have that keyword (??? too much) in my name........
_AnsHUMAN_b>
|
|
|
|
|
Thanks for the hint. I tried it, then the freshly created ncb file was only a few kB in size. But intellisense in C++ projects did not work anymore...
|
|
|
|
|
That is because the ncb is the intellisense information. It was huge because it had generated the required information for all your C# projects just in case your C++ project was to reference them. The ncb is only used for intellisense and won't compile into your final solutions, so there really isn't much point in removing it from your solution as it will break your C++ intellisense.
|
|
|
|
|
Dear All!!!
I want to create webbrowser control at runtime. for this i created one class to handle runtime created webbrowser. meantime i will be calling this class in threads, might be 10 threads at a time.
I made one class where i am creating webbrowser control. and i have made properties and events to handle this browser.
if i call this without thread, its ok.
But i want to call this class in thread. i tried but the document completed event does not get fired in this class.
see the code...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WebBrowserExample
{
public class Class1
{
public WebBrowser Browser=new WebBrowser();
public delegate void DocumentCompletedDelegate(string DocumentText);
public event DocumentCompletedDelegate DocumentCompletedEvent;
public Class1()
{
Browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted);
}
public void NavigateUrl(string Url)
{
Browser.Navigate(Url);
}
public string DocumentText
{
get;
set;
}
void Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (Browser.ReadyState == WebBrowserReadyState.Complete&&Browser.Document!=null)
{
DocumentText = Browser.DocumentText;
if (DocumentCompletedEvent != null)
{
DocumentCompletedEvent(DocumentText);
}
}
}
}
}
I am calling this class through form ..
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;
using System.Threading;
namespace WebBrowserExample
{
public partial class Form1 : Form
{
Class1 class1;
Thread BrowserThread;
public Form1()
{
InitializeComponent();
class1 = new Class1();
class1.DocumentCompletedEvent += new Class1.DocumentCompletedDelegate(Class1_DocumentCompletedEvent);
}
void Class1_DocumentCompletedEvent(string DocumentText)
{
webBrowser1.DocumentText = class1.DocumentText;
}
private void button1_Click(object sender, EventArgs e)
{
BrowserThread = new Thread(StartBrowsing);
BrowserThread.SetApartmentState(ApartmentState.STA);
BrowserThread.Start();
}
void StartBrowsing()
{
class1.NavigateUrl("http://codeproject.com");
}
}
}
in this form there is webbrowser control so when class's browser gets completed the form's webbrowser document text should be updated.
Any idea will be appreciated .
Thanks!
|
|
|
|
|
The events will not work acrossed thread boundries. They will only get raised on the UI (startup) thread.
The browser will not work on anything other than the UI thread. You cannot create a new browser instance on a seperate thread and expect it to work.
|
|
|
|
|
The web browser must operate on the main thread. It's all very well getting information for it in background threads, but these must ultimately be marshalled back to the primary thread.
|
|
|
|
|
|
You're going to have to explain what you mean by that and where you're looking. You could be referring to about 5 different things that I know of.
And your subject line is stupid. You're posting in the C# forum, so it's pretty obvious you're dealing with C#.
|
|
|
|
|
Sorry but your question is not clear.
What exactly do you mean by a "cluster"?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
His reply:
I want to create webbrowser control at runtime. for this i created one class to handle runtime created webbrowser. meantime i will be calling this class in threads, might be 10 threads at a time.
OK. You don't really need an entire class to create a web browser instance, but whatever...
Your threads (10 is probably too many) would have to marshal whatever manipulations they want back to the UI thread to aply those changes to the browser control. This would require you to create appropriate methods to make the changes.
|
|
|
|
|
What would you like it to be?
|
|
|
|
|
I have searched and searched, and I just cannot find this solution. I know its out there becasuse I found it before.
Ok, I have a byte array of a fixed length, say 5 bytes.
I want to represent the byte array as a fixed length number, without using int, long etc etc.
I then want to be able to have the number entered by the user into an edit box, and encode it back to the byte array.
So, for example...
User enters the following (these are examples, not actual values)
2354 3488 3433 2332
Then this in decoded into its byte array representing the data.
In my seperate generator, I set the bytes, and it encodes as:
2354 3488 3433 2332
I am really looking for 2 brief code sample functions like the following
private void convertSerialNumber(string serial)
{
encode into byte array
}
private void convertByteToSerial (byte[] arr)
{
decode into serial (2354 3488 3433 2332
}
The reason I need to do this, is once I generate the byte array, I want to encrypt it.
If I simply use standard conversion routines, or use the string to int fuctions etc, I cannot do this
Could someone PLEASE provide brief coding examples.
I believe the functions I found before were custom functions using bit operators.
Converting and displaying as hex is no problem as they are built in, and I can find many examples of BASE32 encode/decode, but I relay want to represent my data as digits like 0000 0000 0000 0000
I hope this is clear enough as it is yet again driving me insane, and I am trying, I have spent a few months yet again.
Thank you so much in advance.
Steve
|
|
|
|
|
By default a number is already in base 10. Unfortunately, you are confusing a few concepts. For example:
string number = "2354 3488 3433 2332";
is not a base 10 encoded number it is a Unicode string occupying 20 bytes. Here is what you most likely want:
using System.Security.Cryptography;
using System.IO;
...
Int32 anInteger = 1233455;
DES des = DESCryptoServiceProvider.Create();
ICryptoTransform transform = des.CreateEncryptor();
CryptoStream stream = new CryptoStream(memorySteam, transform, CryptoStreamMode.Write);
StreamWriter writer = new StreamWriter(stream);
writer.Write(anInteger);
|
|
|
|
|
Hi Steve,
1.
stephen.darling wrote: 2354 3488 3433 2332
I don't see how that would be an example. A real example would show data before and after the conversion. As it stands, it is just a data sample.
Furthermore, 4-digit numbers will not fit in a byte, as you well know. So how many bytes do you want? One per character (just replace each char by its ASCII ordinal number?).
2.
if 2354 is a string at some point, you can find the equivalent integer by calling upon int.Parse() or int.TryParse(), which I recommend.
3.
Maybe what you want is offered by the BitConverter class; have a look at GetBytes() and some of the ToInt() methods. [[FIXED]]
4.
Probably there are better schemes, that are even easier to implement.
example1: get the input string, convert it to bytes right away, then encrypt. No need to know the numeric values at all.
example2: let the user enter in the format you choose, check the format, remove all non-digits (using string.Replace), then just call long.Parse() once, to get a single 64-bit number.
5.
You seem to be struggling with some elementary C# stuff, are you sure your app needs serial numbers, encryption, and this early stage?
|
|
|
|
|
Luc Pattyn wrote: GetInt()
Surely you mean ToInt?
|
|
|
|
|
yep.
|
|
|
|
|
Your example data is very confusing. You have 8 bytes of data that you are trying to put into a 5 byte array. Without knowing exactly how big your individual elements are there is no way to decode, because you won't know where the boundaries are.
And then the other weird thing is that the numbers are already in base 10.
What exactly is the problem you ran into when you tried to encrypt using standard conversion routines?
|
|
|
|
|
I proberbly havent explained very clearly.
Yes, the following is in base 10
1234 5678 1234 5678
But if I was to simply encrypt the above I would have something like
£$%^%$"$£% (example)
I need to accept a string of digits, then get its bytes.
Then, encrypt the bytes
Then, re-display the encytped bytes as a base 10 representation
So, for example.
I have a byte array
Byte[1] = ID
Byte[2] = version
etc
Then I encode it into a string of base10
0000 0000 000 etc
Then if we enter the above number into a sep function, we can decode it back to
byte[1] etc etc
I did find this before....
Also, the example above, saying to use int64 is no good if my serial number is, for example, 25 digits long
Thank you
Steve
|
|
|
|
|
I'm still not sure what you want. Why not do something like:
string str = arr[0].ToString() + " " + arr[1].ToString();
|
|
|
|
|
Is this to encode or decode, and what function would I use to reverse it?
Also, to clarify, microsoft activation number which is 51 digits long, when decoded into a byte array, is said to be simply a byte representation in litle endian, or a multi presision representation.
You see, if I simply encrypt a string of digits I end up with unreadable data, I could use built in functions to encode it into a hex string or Base32 etc, but I want to represent it as digits.
This is very hard to explain for me, sorry.
Steve
|
|
|
|
|
We still don't get what data you are after. Your last example had version and ID in the array. But we don't know if serial number is supposed to go in the array with those pieces of data or is serial number is supposed to be derived from the data in the array. We also don't know if any of the other potential pieces of data in the array are larger than one byte.
|
|
|
|