|
Hi,
I've a activex browser control in a form. I've added proxy server support to the control by modifying the proxy server settings in the registry. This works fine before the browser control is created (the browser control is only created after a button on the form is pressed). However, once the initial proxy settings are commited and the browser control is created, the browser control does not respond to any new settings even though the registry shows the correct new settings. The browser control seems to be "stuck" on the old settings. How does IE apply any new settings?
Any suggestions?
Thanks
Pieter
|
|
|
|
|
I need to develop a system that can transfer data from 1 pc to another pc using dialup because the user dont want use any FTP service..
so i think i need to create a service at one side that can accept called from another side and get the transaction and stop the connection...
and i need to create i utlity that can dialup and get data and disconnect..
2 utility 1 dialup and 1 accept call..
how do transfer this to my coding any example or source that i can use.. in c#...
or is there any otherway for me to settle this issue.
thanks
joe
|
|
|
|
|
Hi
How I add double quotes to a string.
For instance, I have following;
string s1 = "first string";
string s2 = "second string";
Now I want to combine the two and the result should be:
"first string , second string" (Note: the stirng should contain the starting and ending double quotes")
regards
|
|
|
|
|
You have to escape them with \
string s1 = "\"first string";<br />
string s2 = "second string\"";<br />
<br />
string middle = " , "<br />
string combined = string1 + middle + s2 <br />
You get: "first string , second string"
HTH
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
You have to use escape characters.
string s1 = "first string";
string s2 = "second string";
string result = String.Format("\"{0}, {1}\"", s1, s2);
|
|
|
|
|
and this is one solution
char q = '"';
string one = "first string";
string two = "second string";
string result;
result = q + one + "," + two + q;
"first string,second string"
|
|
|
|
|
My dilema is I have an app that on Button1 starts another app that I need hidden.
So my question is how can I make it so the app that Button1 starts stays hidden?
I appreciate any help,
Thank you
Here is what I have and I have tried every thing to no avail.
Process myProcess = new Process();<br />
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;<br />
myProcess.StartInfo.FileName = "foo.exe";<br />
myProcess.StartInfo.CreateNoWindow = true;<br />
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;<br />
myProcess.StartInfo.FileName = "c:/program files/MyHiddenapp/foo.exe";<br />
myProcess.Start();<br />
myProcess.WaitForExit();
bklynjava
-- modified at 20:07 Sunday 18th December, 2005
|
|
|
|
|
Ultimately, you can't control what the app itself does. If the app forces itself to be shown, there's nothing you can do about it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I don't think thats the case with this, as there is a windowHider app tutorial that will hide it - I may be wrong and the method is different - But I'm pretty sure the right person will know how to either hide it or minimize to tray anything that will remove its Ugly console face from in front of the Primary app.
|
|
|
|
|
Console app? Then you've already done it the correct way.
Process proc = new Process();
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.StartInfo.FileName = @"NSLOOKUP.EXE";
proc.Start();
Works perfectly fine for me. No console window shows up.
[EDIT]
Might help if I posted the correct language...
[/EDIT]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 23:13 Sunday 18th December, 2005
|
|
|
|
|
Yeah thats the odd problem I been having.
Seems I can't get it hidden.
|
|
|
|
|
In some computer training institutes, the instructor uses a software whose functions are:
1. when teacher is teaching, whatever he does on his computer appears on the computer of the student as a demo.
2. the student cannot use his keyboard or mouse and all input functions are disabled.
How can these things be managed in C#?
|
|
|
|
|
|
I have a C# problem that I need a solution for. I've pretty much mastered in in VB6, but keep running into brick walls, even with all the tutorials for C#.
Here's the definition of the variables you're about to see...
"ClassStudents" is a class I created to manage an array of students read in from...
"LogReader" This is the name given to the SQL select statement that returns the information I'm trying to use.
"logCount" is simply to keep the array element in check.
while (LogReader.Read())
{
ClassStudents[] Students = new ClassStudents[logCount+1];
Students[logCount].setKnown(LogReader.GetInt32(0), LogReader.GetString(1).....
logCount++;
}
Basically, I need to be able to populate an array of what in VB6 would be a simple 'Type' so I can go back to it for data 'after' the fact.
Everything's fine until I leave the while loop, at which point I seem to lose the ability to reference the "Students" array I created. I tried using Structs as well. I know it must be a fundamental rule I'm breaking, but I just can't find any reference to what is happening in any documentation or help files. I found a post basically outlining the method I'm using, but they stop short of any reason why I wouldn't be able to access the data outside of where it was populated. Kinda defeats the purpose, if you ask me.
|
|
|
|
|
Hope i get this straight....
You want to get an array with ClassStudents, and then fill it using LogReader? Ok, let me try:
ArrayList students = new ArrayList();
int logCount = 0;
while (LogReader.Read()){
ClassStudent student = new ClassStudent(logCount);
student.SetKnown(LogReader.GetInt32(0), LogReader.GetString(1));
students.Add(student);
logCount++;
}
ClassStudent firstStudent = (ClassStudent)students(0);
And structs or classes don't really matter for this, the differences between those are completely different.
HTH!
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Ok. That 'kind of' works...
I was able to declare the ArrayList "students", create a new class object "student", pass the values into the object "student" (as far as compile time goes.. can't really test it because of the following...) and add the object "student" to the ArrayList of "students". Ok so far. Now when I try to use the intellisense for "students." I don't get any of the functions that I need to be able to call from the class object that it is comprised of. Pretty pointless if I can't use the functions the whole class was designed for. Any suggestions?
Here's a summary of what I need to accomplish...
1. read multiple records (with multiple fields of varying data types, of course) from a table in a database into an array of some sort.
2. While reading the rows, populate a listbox with a built sting with some of the information (but not all) // This much I can handle all well and dandy
3. I need to be able to pull up various elements from the 'full' array of data for a given line when a user clicks on one of the corresponding "index number" line in the listbox.
4. I had this licked with a handy-dandy "type" variable array in VB6, but C# is just TOTALLY not going to settle for the same approach. I need some advice on the best way to approach this problem. I've wasted over 8 hours already, trying to find a means for something that took me a whopping 20 minutes in VB6, and I feel no closer now than when I started.
|
|
|
|
|
As an ArrayList contains reference to the type Object, you have to type cast the item to use it:
((student)students[42]).MyMethod();
---
b { font-weight: normal; }
|
|
|
|
|
Great. That worked (with a minor edit... needed to replace student with ClassStudent).
A recap for any that browse for a solution of this nature...
// This, I actually placed after the "System Generated Object Declarations" for increased scope.
ArrayList students = new ArrayList();
// The while loop...
while (LogReader.Read())
{
// Make a new student
ClassStudent student = new ClassStudent();
// Fill it with data (Added some nullchecking since original post.. not shown)
student.SetKnown(LogReader.GetInt32(0), LogReader.GetString(1));
// Now add the new student to the students arraylist
students.Add(student);
// Now students is filled with each student (duh), and you can still reference it
// Now you can get a student like this:
// With ArrayList you have to cast from object to a ClassStudent
(my apologies for not catching this... thanks for pointing it out in more detail, Guffa )
// Can use this anywhere you like..
((ClassStudent)students[indexNum]).MyMethod();
Thanks a "metric buttload" to both of you.
|
|
|
|
|
You are making three errors in that loop:
:: You are creating the array inside the loop. That means that the scope of the array is the loop, so you can't use it outside the loop.
:: You are creating a new array for each iteration. That means that the previous array is discarded along with the previos item. After the loop you will have an array where every item is null except the last one.
:: You are not creating any ClassStudents objects. That means that you can't call the setKnown method as the reference that you try to use to make the call (the item in the array) is null.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: :: You are not creating any ClassStudents objects. That means that you can't call the setKnown method as the reference that you try to use to make the call (the item in the array) is null.
I think that's why he tried structs instead .
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
HI All
I need to add timer to do some "job" every X second.
I know that i can do it in class that divided from Form class , but i need to do it from class that is not divided from Form class ...
How can i do it in C# ?
[I'm using IDE v.s 2005]
Thanks
|
|
|
|
|
Look at System.Timers.Timer. You can use one of those timers to do what you need.
|
|
|
|
|
I have another problem, errr, challenge now. I am using an SQL database to save the info the person chooses on one form (pedbone.cs).
Here's the code to the Combobox I've got on the "main" form (pedbone.cs):
m_cTypes = new ArrayList();<br />
m_cTypes.Add("Unknown"); <br />
m_cTypes.Add("Male");<br />
m_cTypes.Add("Female");<br />
TypeCombo.DataSource = m_cTypes;
These are listed in a ListView
SqlCeCommand sqlLoadEvents = m_cConn.CreateCommand();<br />
sqlLoadEvents.CommandText = szSQL;<br />
SqlCeDataReader rReader = sqlLoadEvents.ExecuteReader();<br />
<br />
while ( rReader.Read() )<br />
{<br />
lvItem.SubItems.Add(GetTypeFromNumber ((int)rReader.GetValue(rReader.GetOrdinal("MovieType"))));
CollectionList.Items.Add( lvItem );<br />
}<br />
}
And here I got the Combobox text to show in the ListView, by using this code
private string GetTypeFromNumber(int nTypeID)<br />
{<br />
return (m_cTypes[nTypeID].ToString());<br />
}
Now, when you click on the listview item, a new form opens up (AddEditMovieForm.cs) to view the file in more detail. And here's where I'm running into a bit of a bind.
public AddEditMovieForm(SqlCeConnection cConn, int nMovieID)<br />
{<br />
InitializeComponent();<br />
<br />
m_cConn = cConn;<br />
m_nMovieID = nMovieID;<br />
m_cTypes = new ArrayList();<br />
<br />
if ( m_nMovieID != -1 )<br />
{<br />
SqlCeCommand sqlCommand = m_cConn.CreateCommand();<br />
sqlCommand.CommandText = "SELECT * FROM MOVIE_MNGR_TABLE where MovieID = "+m_nMovieID.ToString();<br />
<br />
<br />
SqlCeDataReader rReader = sqlCommand.ExecuteReader();<br />
if ( rReader.Read() )<br />
{<br />
<br />
}<br />
<br />
{<br />
<br />
GenderLabel.Text = rReader.GetValue(rReader.GetOrdinal("MovieType")).ToString();
<br />
{<br />
}<br />
}<br />
<br />
<br />
}<br />
}
Any help would be appreciated. I would like to add "male" or "female" into the GenderLabel.Text field. If I neglected to add any important code, please let me know.
Thanks guys,
M.
|
|
|
|
|
Class DateTime have read-only property Now for get current system time. But I can't find any method to set system time.
- - -
|
|
|
|
|
Andrey_Mark wrote: But I can't find any method to set system time.
Probably because the designers of the .NET Framework didn't think it would be useful. Setting the System time is an Administrator function (if I remember correctly) and many people now syncronise their PCs with an atomic clock over the internet or it is set via a central server in the enterprise.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|