|
Thanks Friend. But I had tired of it and I now I have made all new. I deleted the web page and txt file and develop a new page. I think it is the only solution of the situation. Now it is working correct. Thanks for your time.
God Bless You
Syed Shahid Hussain
|
|
|
|
|
You propably need to restart the iis before you can operate on the file again.
Kind Regards,
John Petersen
|
|
|
|
|
Thanks but I have checked with the restart of my computer. Error again same.
God Bless You.
Shahid
|
|
|
|
|
hi all,
firstly: am i able to change the default icon for my setup and deployment project?
(not a shortcut's icon but 'the main setup.exe's icon')
>if yes, then let me know how i can do that please?
secondly: when i build my project, i see 2 different things in Debug folder: one is ***.msi and the other is setup.exe.
what is ***.msi ? why is that created beside setup.exe ?
when i copy these two things separately on my desktop: setup.exe cant be installed without ***.msi. cos i receive an error which tells me that setup.exe couldnt find **.msi.
but ***.msi itself can be installed without setup.exe ???
please inform me about two questions above ...
thanks in advance, bye.
MFA
|
|
|
|
|
Hello
Mehmet Fatih Akbulut wrote: am i able to change the default icon for my setup and deployment project?
Not that I know of! You can change the icon of the output of an ordinary WindowsApplication project. Not tyhe setup. Nop!
However if you hav an external Icon editor that has the capability of changing the icons of exe files. be my guest!
Mehmet Fatih Akbulut wrote: what is ***.msi ?
This is the package file. That contains all the files and settings of your application.
Mehmet Fatih Akbulut wrote: why is that created beside setup.exe ?
Actually it's the other way around. This is the main file in your whole project.
Mehmet Fatih Akbulut wrote: setup.exe cant be installed without ***.msi
Sure! The Setup.exe only opens this package. It doesn't contain anything in itself.
Mehmet Fatih Akbulut wrote: but ***.msi itself can be installed without setup.exe ???
Because it contains all the necessary files and data to install your application on the user's machine, and if you double click on it, Windows Installer does the job for you.
Regards
|
|
|
|
|
Hi!
If you mean the icon you get under Add/Remove programs, then yes, you can set this icon in the properties of your setup project.
If you want to change the icon for setup.exe, you can simply open the file in VS using the resource editor. Then you can modify the resources (icons for examples) to your heart's desire.
Setup.exe is just a bootstrapper for the msi file. It checks whether the correct (and required) version of windows installer (3.0) is installed and if it isn't, it's trying to install it.
Afterwards, windows installer is told to install the msi file.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello all.. I am trying to construct a way of extracting data from a network stream.
However I am running into a small problem. I am using regex to detect a pair of return & newlines "\r\n\r\n". However some of the messages received have "\r\n\r\n" in the middle of the stream. So some of the messages are cut off halfway.
<br />
byte[] ami_response_buffer = new byte[ami_buffer_size];<br />
MemoryStream ami_memory_stream = new MemoryStream();<br />
string ami_response = "";<br />
int ami_bytes_read = 0;<br />
<br />
do<br />
{<br />
ami_bytes_read = ami_client_stream.Read(ami_response_buffer, 0, ami_buffer_size);<br />
ami_memory_stream.Write(ami_response_buffer, 0, ami_bytes_read);<br />
ami_response = Encoding.ASCII.GetString(ami_memory_stream.GetBuffer());<br />
<br />
if (Regex.Match(ami_response, "\r\n\r\n", RegexOptions.IgnoreCase).Success)<br />
{<br />
ami_bytes_read = 0;<br />
}<br />
}<br />
while (ami_bytes_read > 0);<br />
<br />
return ami_response;<br />
What is the best way to detect the end of a data stream?
Thanks in advance...
Phil
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Hello
keep reading until NetworkStream.DataAvailable becomes false.
Regards
|
|
|
|
|
I'm assuming that "\r\n\r\n" is the marker you are trying to use to indicate the end of the stream. You would want to do something like this:
string ami_response = "";
if (ami_client_stream.CanRead)
{
byte[] ami_response_buffer = new byte[ami_buffer_size];
MemoryStream ami_memory_stream = new MemoryStream();
int ami_bytes_read = 0;
myCompleteMessage = new StringBuilder();
do
{
ami_bytes_read = ami_client_stream.Read(ami_response_buffer, 0, ami_response_buffer.Length);
myCompleteMessage.AppendFormat("{0}", Encoding.ASCII.GetString(ami_response_buffer, 0, ami_bytes_read));
}
while (ami_client_stream.DataAvailable);
ami_response = myCompleteMessage.ToString();
}
return ami_response;
|
|
|
|
|
Hi,
My win form is always getting minimized after splash screen is shown and closed. Although my form's WindowState property is set to Normal. Is there any code piece I am missing to keep my original window STAND !!
Thanks.
/********************** My code ****************************/
public mainForm()
{
InitializeComponent();
th = new Thread(new ThreadStart(DoSplash));
th.Start();
}
private void DoSplash()
{
sp = new Splash();
sp.ShowDialog();
}
private void mainForm_Load(object sender, EventArgs e)
{
th.Abort();
}
|
|
|
|
|
Hello
1- First, the code above -AFAIK- shouldn't minimize your original form. Yet you might be missing something else somewhere!!
2- Second, the code above is a bit odd. Why do you call ShowDialog from another thread while simply you could just show the form in your own thread -make things simple!!-.
private void mainForm_Load(object sender, EventArgs e)
{
Splash MySplash = new Splash();
MySplash.Show();
MySplash.Close();
}
I guess you are making a splash while loading your form -which might be a lengthy process in your case-. Maybe you minimized you main form somewhere while loading its UI?!!
Regards
|
|
|
|
|
Dear Nader,
the reson why you put a splashscreen in a separate thread is that otherwise the splashscreen isn't updated while the main thread is busy doing other things.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello Mav
Nice to see you on the forum today
Danke für den tipp!
Regards
|
|
|
|
|
Hi!
There's no reason in the code you showed us why the main form should be minimized.
But another point I noticed was your use of Thread.Abort() .
Usually this is considered bad practice - it's better to let the thread exit gracefully.
You could do this by adding a method
private void CloseSplash()
{
sp.Close();
} and calling sp.BeginInvoke(new MethodInvoker(CloseSplash)); instead of th.Abort() .
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi Mav,
Thanks for your time. AS you said, I should use,
sp.BeginInvoke(new MethodInvoker(CloseSplash)); instead of th.Abort(). Is it because I am doing inter threaded operation ?
Regards,
|
|
|
|
|
Exactly.
If you're just calling sp.Close() you'll get an IllegalInterThreadOperationException.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I have multiple threads in my Win application and those retrieve connection string from app.config file concurrently. Although each thread use its own sql connection instance, yet I was worried to think that, if there is any chance to get crash when those threads reading the app.config file to get the connection string concurrently ? In that case Do I need to Lock the config file ?
The snippet I use for retrieving the connection string as follows :
SqlCeConnection myConn = new SqlCeConnection(ConfigurationManager.ConnectionStrings[1].ConnectionString);
Thanks and regards
|
|
|
|
|
Unless you plan to edit them at runtime (possible with the ConfigurationManager ) then no. Race conditions only matter, and therefore have to be prevented, if threads are reading and writing concurrently. They do also matter if threads are writing concurrently and you care about which result is written.
|
|
|
|
|
Hi Mike, thanks for your reply.
So, as my situation is just only reading connection string and no writing or editing, so I dont need to worry about Locking. RIGHT ?
Thanks and regards,
Emran
|
|
|
|
|
|
hi everybody,
i was given a job of developing a function which accepts 3 parameters i.e., an assembly path, a class with namespace, and a method in that assembly. the function should return the value that is being returned by the method that iam invoking(the one which we passed as a parameter)
iam using system.reflection namespace.
the problem is, i also need to pass arguements to the method that iam invoking but it is just not working the i way i want. this is how iam calling my function ..
public int myreflect("..the path of the assembly..", "...calss name with namespace..say N.C1..","..method name..say M1..", 2,4) // 2,4 are the arguments iam passing to my method M1//
this is how iam defining my function
public int myreflect(string a, string b, string c, params int[] list)
everything is working except that i need to somehow extract the arguements which are in the param array i.e., list.
i need to capture those arguments and store them in another array..say int[] args..and use this args in Invokemember function, as parameters to invoke my M1 method. i hope i have done a fair job in explaining my problem. a little help would be greatly appreciated. Thanks in advance....
Sonu
|
|
|
|
|
As InvokeMember takes an object array, copy the content of the integer array into such an array and then pass it to InvokeMember .
object[] args = new object[list.Length];
list.CopyTo(args, 0);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thanx Stefan!!
this is exactly what i wanted.
iam gratefulto you....thanx once again..
Sonu
|
|
|
|
|
Hi
How can I have Windows open a file using the default program? eg. ".txt" files open with notepad, etc.
Thanks (The function's at the back of my head somewhere, but I just can't find it... )
|
|
|
|
|
thepersonof wrote: The function's at the back of my head somewhere, but I just can't find it...
Look for the brain cell labeled Process.Start and you found it
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|