|
Well, you need an account that gives you admin rights to all the machines. Your code is saying that the account it's running under doesn't have it.
Just having access to the hidden shares on the machines isn't enough.
|
|
|
|
|
well i do know the "administrator" and its password account for each box i need
how would i pass that to the machine
-- modified at 9:19 Monday 18th June, 2007
for example lets say i usually log in as
User:administrator
Pass:crash893
to the local machine
how would i pass that too the get proccess method so that the computer on the other end would know its me?
|
|
|
|
|
Well, it might be you can do something like:
System.Threading.Thread.CurrentThread.CurrentPrinciple = New System.Net.NetworkCredential("user","pw")
or something along those lines. I HAVE NO IDEA IF THIS WILL WORK!! I HAVE NOT TESTED IT AND DON'T HAVE AN ENVIRONMENT TO TRY IT IN!!
|
|
|
|
|
that looks very promising
i will try it at work tommrow
would i run that at form load? or in the event?
edit
did you mean
CurrentCulture i dont see anything else close?
|
|
|
|
|
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Net.NetworkCredential("user","pw");
doesnt want to work Error Cannot implicitly convert type 'System.Net.NetworkCredential' to 'System.Globalization.CultureInfo'
|
|
|
|
|
Hello
Have you got the solution of your problem...if yes then plz tell me because i am facing the same problem...
Thanks
Devesh Mishra
|
|
|
|
|
|
I wrote an application that is copying a file. I'm also writing a progress bar function for it. The function works fine until what should be 6%, then it starts displaying a negative value.
This is the line where the problem is occurring:
double Completed = BufferSize * (Chunks - 1);
some background:
BufferSize = 524288000
(Chunks - 1) = 6
the result i would expect is: 3145728000
however it is displaying: -1149239296
i would assume the double datatype should be large enough. I tried to explicatly cast it as a double as well however no luck there.
Please Help!!
Thank you,
Steve
|
|
|
|
|
Have you looked at the datatype of Mininum, Maximum, and Value properties of the ProgressBar control? Notice they're int 's and not double 's? What's the range of values an int ger can hold? -2,147,483,648 to 2,147,483,647, inclusive.
There's your problem. When your value reaches the upper limit of an integer it wraps around to the negative side, hence the negative number.
Your going to have to scale your values to fit inside the limits of an int .
|
|
|
|
|
Thanks for the reply. I actually figured this one out before you replied, but your reply sounds like a more permanent solution then what i did.. (i used the decimal data type, which worked until 100%)
|
|
|
|
|
Hi,
when you do an assignment such as
destinationVariable = someExpression
then the type of the destinationVariable is irrelevant while someExpression is
evaluated. So when e.g. someExpression consists of only integers, it will be calculated
using only integers (with possible overflow); it is only when the assignment itself
is going to happen that possibly a conversion (up-casting) will happen.
BTW: same is true for most programming languages (C, C++, Java, ...).
If the expression's type is insufficient to evaluate correctly, you must make sure
a more capable type is used (e.g. by using wider constants such as 1.0 which
causes part of the expression at least to use doubles, by using a long/float/double
variable, or - at the right place - inserting a long/float/double cast).
|
|
|
|
|
Hey guys,
I have a PictureBox on a form, it has lines drawn on it via
Graphics g = thisform.CreateGraphics();
g.DrawLine(p, ps, pe); // connecting dots ps and pe, p is the pen
However, whenever I minimize the form the contents are lost, or if I bring something on top of these picture boxes the portion that was covered is lost-
How can I make the drawings persistent!? Thanks for your help.
raheel
|
|
|
|
|
Hi,
the normal way to draw things is to add drawing commands to the Paint handler;
that code gets executed whenever the drawing got damaged (e.g. after a Minimize)
or when Invalidate() gets called.
As a consequence you need data structures that represent everything that needs to
be drawn inside the Paint handler; when doing animation, a timer would in its
tick handler modify the data, then call Invalidate().
|
|
|
|
|
rbengali3 wrote: Graphics g = thisform.CreateGraphics();
Never, ever, do this, unless you want to draw something temporary and easy to erase.
Your picture box is a waste of time, it's a control for easy showing of a bitmap. If you're drawing lines, the control never does anything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the reply Luc.
Christian, I don't understand. Should I skip the picture box completely and draw directly on the form with simmilar code?
Thanks
|
|
|
|
|
You should NEVER use CreateGraphics to draw things you don't want to lose. Yes, you should draw directly onto the form, using the paint event.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
when you minimize the window, all the unfocused or unused parameters be collected to the garbage, so you need to keep focus in the picturebox by drawing in a timer;)
|
|
|
|
|
I am really stuck trying work out and understand how to achieve the following. I have a collection of objects and want to peform some data analysis on each of the fields in turn using a method.
The collection
List<CardData> CardDataCollection = new List<CardData>();
CardData class contains fields called Card1,Card2,Card3 etc
The code below has been simplified to show what I'm currently doing for one of the collection object fields (CardDataCollection[i].Card1 ).
public static void CalcData()
{
int i;
for (i = 0; i < CardDataCollection.Count; i++)
{
if (CardDataCollection[i].Card1 == 1)
{
}
}
}
I need to perform the same exercise on each of the Card fields (for Card1 upto Card100) in the collection so I want to create a method that will allow me pass in some kind of reference to the collection object field (CardX ).
Note: I need access using the [i] as the data processing requires me to use for example [i-5] (i.e can't use foreach loops)
I know what I want it do but just can quite get my head around how to do it. I'll try to explian below how I would change the code.
public static void CalcData(reference to relevant card number field eg Card50)
{
int i;
for (i = 0; i < CardDataCollection.Count; i++)
{
if (Card50[i] == 1)
{
}
}
}
Please excuse any incorrect technical description as I'm only new to this C#. Thanks in advance for any help you can give me.
Haz
|
|
|
|
|
haz13 wrote: I need to perform the same exercise on each of the Card fields (for Card1 upto Card100)
Why don't you use a card array of size 100?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Sorry Greeeg I don't understand how that would help what I'm doing (please explain more - maybe I haven't explined it very well)? Basically I need to itterate through all the collection object fields in turn. I have a method that does it for one of the fields, but instead of copying it 100 times and slightly changing the field refernces I was trying to create a method that was more generic (this is the bit I can't get my head around).
CardDataCollection[0].Card1
CardDataCollection[1].Card1
CardDataCollection[2].Card1
CardDataCollection[3].Card1
CardDataCollection[4].Card1
CardDataCollection[5].Card1
to end of collection
Then I need to do the same for the Card2 field
And so on for each of the remaining Card fields upto 100
CardDataCollection[0].Card100
CardDataCollection[1].Card100
CardDataCollection[2].Card100
CardDataCollection[3].Card100
CardDataCollection[4].Card100
CardDataCollection[5].Card100
to end of collection
Put another way I need one method to prevent me creating 100 very similar methods as described below.
public static void CalcDataCard1()
{
int i;
for (i = 0; i < CardDataCollection.Count; i++)
{
if (CardDataCollection[i].Card1 == 1)
{
}
}
}
public static void CalcDataCard2()
{
int i;
for (i = 0; i < CardDataCollection.Count; i++)
{
if (CardDataCollection[i].Card2 == 1)
{
}
}
}
public static void CalcDataCard3()
{
int i;
for (i = 0; i < CardDataCollection.Count; i++)
{
if (CardDataCollection[i].Card3 == 1)
{
}
}
}
Thanks again for any help.
Haz
|
|
|
|
|
haz13 wrote: (for Card1 upto Card100)
As someone else said, instead of having 100 fields, have a collection which contains them ( and if they are named card1-card100, an array makes sense, you just put the number in the indexer ). Then you can iterate over them with foreach to do your test.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi all,
l made a class and i want to export its values stored in members data to an excel file
can any one give me a beginning
my class like
<br />
static class Export<br />
{<br />
private static ArrayList arrivalRate = new ArrayList();<br />
private static ArrayList customersNo = new ArrayList();<br />
}<br />
and i wanna to make member data is the header of the row and the values in the arraylist are in squence in the adjacent cells.
also i wanna to ask about automatic documentation, i used SandCastle but i cannot deal correctly with it, so can any one give me a program that only executable file i give it the file path only like what happened in javadoc.exe
thanx
Generator
|
|
|
|
|
|
Hi,
thanx for ur help ur information make me make it successfully
thanx alot
Generator
|
|
|
|
|
glad to help
|
|
|
|