|
max29297 wrote: The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program.
What version?
|
|
|
|
|
The Express ones by default download what they need, just a simple bootstrapper to start things going, you can download CD images of them though to burn.
|
|
|
|
|
THanks Ed!
|
|
|
|
|
max29297 wrote: THEREFORE I cannot install this program onto my pc.***
You can download a CD image of Visual C# Express and burn that to a CD so you don't have to be connected to the internet.
|
|
|
|
|
FYI: Full iso images of the express editions can be downloaded here. Unlike the bootstrappers you shouldn't need an internet connection to install.
http://msdn.microsoft.com/vstudio/express/support/install/[^]
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
How do you run an application within another application? I think it has something to do with the Process class...
-----
*** Never give me an answer having anything to do with Visual Studio. I don't have this because I have two computers, one being my dad's mac, which is connected to the internet, the other being my pc, which is, sadly, not connected to the internet. The setup for the Visual C# program I think is called a "bootstrap" program, and it needs to connect to the internet to install the program. THEREFORE I cannot install this program onto my pc.***
|
|
|
|
|
one app can launch another app using the Process class,
the simplest approach is Process.Start("myfolder\\prog.exe");
more options are available by instantiating a Process object, and using StartInfo property.
The second process is a process in its own right, it does not run inside the first process
(whatever that would mean).
|
|
|
|
|
I need help in making a small program
I am trying to make a program that sits on the desktop never on top of anything unless it is called that is like a start button. when clicked it will open the start menu.
The only this is I need help getting the actual code that will bring it up.
Yesterday I saw a piece of code that will tell the computer that ctr + esc has been pressed when you click on it and it will open it up at where you click but it was in visual basic and I know C#
|
|
|
|
|
Post a link and some of us can help translate it if needbe if it does exactly what you want.
|
|
|
|
|
ok I'll try to find it again
|
|
|
|
|
I can't seem to find it again... dang I shoulda wrote that down...
but while I was trying to find it I found this too:
Visual basic (missing the link)
Private Const KEYEVENTF_KEYUP =
a delphi code peice:
http://delphi.about.com/cs/adptips2000/a/bltip1100_5.htm[^]
procedure TForm1.Button1Click(Sender: TObject) ;
begin
SendMessage(Form1.handle,
WM_SYSCOMMAND,
SC_TASKLIST,0) ;
end;
mabye I should learn how to give the computer a command saying ctrl + esc was pressed and to open it at the mouse.
|
|
|
|
|
You'll might be able to override the WndProc method of a form to do what you want, otherwise you can set up a global hook (articles here on CP about how to do that) but I don't think that you can use keys already in use, for example Ctrl+Esc, Start+R.
|
|
|
|
|
ok I'll try a global hook thnks
|
|
|
|
|
I am trying to open a filestream and have read only access to who ever tries to open the file after it has already been opened. This is the code I am using:
m_oFileStreamTest = new FileStream(l_szLocation, FileMode.Open, FileAccess.ReadWrite, FileShare.Read);
m_oZipFile = new ZipFile(m_oFileStreamTest);
This is the error I get when the second user tries to open the file:
"The process cannot access the file
'C:\..\...\..me.apts.resource.rld' because it is being used by another process"
What am I doing wrong?
|
|
|
|
|
RussBus wrote: What am I doing wrong?
Once you open the file for the first time you only permit others to read the file. But the file is being opened for read AND write, so it fails.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
How do I go about doing it then, so that the first person to use it gets Read and Write access?
|
|
|
|
|
The first person to access the file can request anything they like (assuming also the the file permissions allow it - e.g. a file can be marked as readonly in the file system). It is the subsequent requests that are restricted by what the first has allowed. Obviously when the first person releases the file the next person can request what they like.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Easy. Handle the error in a Try/Catch block. If the open fails, try to open the file again using FileAccess.Read .
|
|
|
|
|
Hi,
FileAccess tells what the caller wants for itself, FileShare tells what the caller
allows others to do...
In order to help you make the right choices, you need to provide more information:
- is it two different programs that need access ? (if so, are you in charge of both
of them ?) or is it two instances of the same program ?
- does one program only need to be able to read, or do you want both to be able to
write ? if so, any idea what may happen when both decide to write ? how do you think
you will cope with that ? (what will keep them from creating an inconsistent
bunch of bytes ?).
|
|
|
|
|
The following is what I am trying to prevent:
The server is currently accessing a file and a user goes to get that same file. Currently if I do nothing what will happen is the user will access that file without knowing that they are in read only and when they go to save it will crash.
So I want a message to pop up when you open the file to let you know you are read only, and when they go to save they get another message saying they can't save the file but takes them to a Save As window.
|
|
|
|
|
That sounds simple enough:
1. on user open, first try open in Mode.readwrite, if that fails, try open in Mode.read
and alert user
2. on user save, try save the file, if that fails, try to "save as".
I dont see the problem. If coded correctly, a save never "crashes".
Things to keep in mind:
1. you need a try-catch for each operation that might fail (each try in above text)
2. dont carry any file state information from 1. (try to open) to 2. (try to save) since
there is no need to, and the state may have changed anyhow.
3. Dont forget to always Dispose() or Close() things that need it (such as FileStreams).
|
|
|
|
|
|
I am doing .Net Remoting and i get following exception what can be the reason?
1. Interface
<br />
public interface DeptInterface<br />
{<br />
bool ExecuteSelectCommand(string selcommand);<br />
string GetRow();<br />
void Init();<br />
}<br />
<br />
2. Server.cs
<code><br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
public class CustServer : MarshalByRefObject, DeptInterface<br />
{<br />
private SqlConnection myConnection = null;<br />
private SqlDataReader myReader;<br />
<br />
public CustServer() { }<br />
<br />
public void Init()<br />
{<br />
try<br />
{<br />
String strConn = "Data Source=KPTEST1;Initial Catalog=Store;Integrated Security=SSPI";<br />
myConnection = new SqlConnection(strConn);<br />
myConnection.Open();<br />
if (myConnection == null)<br />
{<br />
MessageBox.Show("OPEN NULL VALUE =====================");<br />
return;<br />
}<br />
}<br />
catch (Exception es)<br />
{<br />
MessageBox.Show("[Error WITH DB CONNECT...] " + es.Message);<br />
}<br />
}<br />
public bool ExecuteSelectCommand(String selCommand)<br />
{<br />
try<br />
{<br />
MessageBox.Show("EXECUTING .. " + selCommand);<br />
SqlCommand myCommand = new SqlCommand(selCommand);<br />
if (myConnection == null)<br />
{<br />
MessageBox.Show("NULL VALUE =====================");<br />
return false;<br />
}<br />
myCommand.Connection = myConnection;<br />
myCommand.ExecuteNonQuery();<br />
myReader = myCommand.ExecuteReader();<br />
return true;<br />
}<br />
public string GetRow()<br />
{<br />
if (!myReader.Read())<br />
{<br />
myReader.Close();<br />
return "";<br />
}<br />
int nCol = myReader.FieldCount;<br />
string outstr = "";<br />
object[] values = new Object[nCol];<br />
myReader.GetValues(values);<br />
for (int i = 0; i < values.Length; i++)<br />
{<br />
string coldata = values[i].ToString();<br />
coldata = coldata.TrimEnd();<br />
outstr += coldata + ",";<br />
}<br />
return outstr;<br />
}<br />
Client.cs
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("TEST1");<br />
bool ensureSecurity = true;<br />
ChannelServices.RegisterChannel(new TcpClientChannel(), ensureSecurity);<br />
dept = (DeptInterface)Activator.GetObject(typeof(DeptInterface), "tcp://KPTEST1:8080/CustServer");<br />
if (dept == null)<br />
{<br />
MessageBox.Show("TCP SERVER OFFLINE ...PLEASE TRY LATER");<br />
return;<br />
}<br />
dept.Init();
MessageBox.Show("TEST2");<br />
}<br />
It gives exception at dept.Init() ? What can be the reason please help me...
|
|
|
|
|
I'm guessing that just by the error message the other machine you're connecting to doesn't want to be connected. A firewall perhaps?
|
|
|
|
|
Ed, I am doing on the same machine localhost.
By the way when i removed ChannelRegistry from Client.cs I am getting now following exception:
System.Runtime.RemotingException: Requested Service not found
at dept.Init() method.
HELP ((
|
|
|
|