|
Can you show the code used to start exe?
|
|
|
|
|
string exeFileFullAddress = "C:\\Test\\abc.exe";
System.Diagnostics.Process.Start(exeFileFullAddress);
But I alread try following
ProcessStartInfo psi = new ProcessStartInfo("C:\\Test\\abc.exe");
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.UseShellExecute = true;
Process p = Process.Start(psi);
OR
System.Diagnostics.Process Proc = new System.Diagnostics.Process();
Proc.StartInfo.FileName = "C:\\Test\\abc.exe";
Proc.StartInfo.UseShellExecute = false;
Proc.StartInfo.CreateNoWindow = false;
Proc.Start();
|
|
|
|
|
The solution to make windows service run a GUI application is to set the Windows service run with the "Local system account" and activate the "Allow service to interact with desktop" from the "log on " tab in the Service properties. (when you double click on the Service in the Service console)
But it is not recommended to do such a thing.(for security reasons)
|
|
|
|
|
Okay, lets assume I have 2 socket servers running on separate computer and in third computer I've a client, client do not know that how many servers are running in LAN or whats their IP addresses. Now, I want to make a search for available connections.
Any way guys ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Have them all reply to a UDP broad cast. The broadcast can specify the ip and port which the servers should report to.
Natza Mitzi
|
|
|
|
|
I think I dont get you but are you trying to say that I should start a new server that will have all info about running servers ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
No, he is assuming you can modify the code each one is using.
He wants you to have the socket servers programmed to respond to a UDP broadcast, and you should program your client to send that UPD broadcast.
Are you able to modify the server code in that way?
Codemonkeys don't do it at all. Too busy coding.
|
|
|
|
|
Naruki wrote: Are you able to modify the server code in that way?
Why I cant ?
Well, the thing is I'm developing a pocket pc application. When you select file, right click on it(not actually) and select 'Send via wifi' then it opens my client application. But now I have to know the ip of the server to which I want to send the file and I want to write a code to search all the servers in homenetwork. Like bluetooth, when you send file it searches for another devices.
Both client and server written by me so I can modify the code
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
In that case, it looks like Natza's answer is what you need.
Have your client app send a broadcast UDP, which does not need an IP address. This will only go out on the local network segment (i.e., will not cross a router).
Change your servers to listen for such a broadcast packet. When they see it, they respond with their IP addresses.
How to implement that is a another thing entirely...
Codemonkeys don't do it at all. Too busy coding.
|
|
|
|
|
Ok, if you are reading this you may have seen the issue I was having with trying to us SqlDataReader(SequentialAccess) to read bytes from the VARBINARY(MAX) column. The problem was it wouldn't work with the VARBINARY column.
I have solved it using the IDataReader:
IDataReader myReader = cmd.ExecuteReader(CommandBehavior.SequentialAccess);
if (myReader != null)
{
myReader.Read();
long size = myReader.GetBytes(0, 0, null, 0, 0);
byte[] buffer = new byte[size];
int bufferSize = 255;
int dataIndex = 0;
long bytesRead = 0;
SetProgBar(Convert.ToInt32(size));
while ((bytesRead < size) && ((size - bytesRead) > 255))
{
if (bwLoadPicture.CancellationPending)
{
e.Cancel = true;
SetLabelDownload("Picture download cancelled.");
}
else
{
bytesRead += myReader.GetBytes(0, dataIndex, buffer, dataIndex, bufferSize);
dataIndex += 255;
bwLoadPicture.ReportProgress(255);
decimal FileSize = (Convert.ToDecimal(size) / 1024) / 1024;
decimal CurrentSize = (Convert.ToDecimal(bytesRead) / 1024) / 1024;
SetLabelDownload(String.Format("Downloading.. {0}MB of {1}MB", Math.Round(CurrentSize, 2).ToString(), Math.Round(FileSize, 2).ToString()));
}
}
bytesRead += myReader.GetBytes(0, dataIndex, buffer, dataIndex, Convert.ToInt32((size - bytesRead)));
SetLabelDownload("Finished Downloading.");
MemoryStream ms = new MemoryStream(buffer);
pictureBoxPicture.Image = Image.FromStream(ms);
ms.Close();
}
myReader.Close();
Now my new question is...
Is there a way to do something like this when uploading a file/picture to a database? If you are uploading a large file I would like to display a progress bar. So some how I would have to get the total bytes of the file, then write 255 bytes at a time or so. Is this possible?
|
|
|
|
|
Jacob Dixon wrote: Is there a way to do something like this when uploading a file/picture to a database?
AFAIK, providing exact progress will not be possible. You can use asynchronous method like BeginExecuteNonQuery[^] and display a progress until the callback function executes.
|
|
|
|
|
I see... so this will run it on another thread basically and I can see the start and stop points. Well I was trying to figure out how to see how much bytes have been written to the SQL database somehow. Sad there isn't something to do it...
|
|
|
|
|
hi ,
i'm creating an application that's checks if a blank dvd is inserted in the drive.
i want to prevent that my application is closed by a user using the task manager.
- i've tried to use code injection to Task manager to hide my process from the process list but this solution closes hides other processes but not mine.
- i've tried to use a windows service to verify if the application is still running and to restart it if it is closed ,but shows me the application in the process list but there is no UI.
- I tried to impersonate the code to a higher level user ,but this returns an exception because i'm trying to instanciate "MsftDiscMaster2 discMaster" : discMaster.IsSupportedEnvironment is always to false.
Thx
|
|
|
|
|
I doubt this is possible. I recall seeing this question a couple of times and the general consensus was that it can't be done. Also, your service could be disabled.
Off topic, but why do you want the user not to be able to kill your app? I would generally consider that very hostile behaviour and make sure I remove every trace of it.
|
|
|
|
|
the problem is that only the administrator could be able to close the application.
This application should record every dvd or cd burning action.
that's why i don't want the user to be able to close this application .
To burn a dvd or a cd the User should unlock the dvd burner using this application .
if i tried to run the application in the User account and there is a problem using the isolated storage and the IMAPI2 .
|
|
|
|
|
Maybe when the form is closing you could run another process of that application unless it was closed by a certain user? (Environment.UserName)
|
|
|
|
|
Well, if thats that then make a formless application, name it 'svchost'. Since too many processes have the same name, it will be hard to know which one is yours and if someone closes the wrong svchost process then I'm sure window will react strange and will require a restart. Thats the way I use...;)
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
since the user is not an administator , i'm managing to create a batch file that runs this application at windows startup using the runas command with Administator privilege.
This way , the user cannot stop the application using the Task manager , the UI for this application is visible and i've change the security policies to disable the regedit .
|
|
|
|
|
hi
your problem has been solved by me
i have a program that nothing can close it
and it can watch your application and when something closes it my program
will restart it agane
all you have to do is send me yor application process name(the one that apear in task maneger) and your application path (like c:\windows\myapp.exe)
mmfatemi@yahoo.com
have fun
|
|
|
|
|
I want to extract attachments from a PST or OST file from C# code and save the attachments to my local drives. I use OUTLOOK 2003 with the exchange server.
Any idea is appreciated.
|
|
|
|
|
I'd start here[^]
which should get you started.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
|
I've written some code that takes 2 or more files and joins them together into a single file, essentially duplicating the functionality you see when you use the DOS copy /B file + file + file outputfile command. The problem is that it takes what I consider an exorbitant amount of time to perform this action. Granted the source files are as big as 1gb in size, but it just seems to me that I can make this process faster, so I'm here asking for possible approaches to the problem.
Essentially, I'm opening up each source file and reading blocks of the file at a time, and then writing to the target file. Due to the total size of the target file, I can't simply read in the entire set of files at once (as big as 8gb) and then write it out all at once) I've tried 256k blocks, 512k blocks, and 1mb blocks, but they all perform about the same (no empirical data to back this up, just an "impression"). Is it better to go with reading larger blocks or smaller blocks? Anyone have any insight?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
So you're still pissing about with those videos, don't you have something constructive to do, lets see
John Simmons / outlaw programmer wrote: Anyone have any insight
yep but you should have asked for some HELPFUL insight. Well I'm off the the VB forum to see if I can annoy someone there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Are you doing the read and write synchronously? Did you try using the asynchrounous BeginRead/BeginWrite methods?
|
|
|
|