如何设计一个漂亮的win形式UI.(有点像MSN消息客户端)
我用Google搜索,无法找到开始我的befault win表单学习的方法.我是否想念一些C#win form design tech?我必须开始.net 3.5学习吗?
使用.net 2.0 vs2005.
可能重复:
什么限制了c中嵌套循环的数量?
你好.
当我读到我的C书时,它说
Run Code Online (Sandbox Code Playgroud)Nesting for-Loop in C can continue even further up to 127 levels!
怎么127来的?
我的书没有提到这一点.对我来说就像一个神奇的数字.
[更新]
int main()
{
int number, n, triangularNumber, counter;
triangularNumber = 0;
for (counter = 1; counter <= 5; ++counter){
printf("What triangular number do you want? \n");
// using a routine called scanf
scanf("%i", &number);
triangularNumber = 0;
for (n =1 ; n <= number; ++n)
triangularNumber += n;
printf("Triangular number %i is %i\n", number, triangularNumber);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud) List<string> list = new List<string>();
list.Add("A");
list.Add("B");
List<string> list1 = new List<string>();
list.Add("a");
list.Add("b");
for (int i = 0; i < list.Count; i++)
{
// print another list items.
for (int j = 0; j < list1.Count; j++)
{
Console.WriteLine("/" + list[i] + "/" + list1[j]);
}
}
Run Code Online (Sandbox Code Playgroud)
我想像这样编码string tmpS =+ list[i];加入下一个列表项togeter.
然后打印 tmpS
但编译错误CS0023:运算符'+'不能应用于'string'类型的操作数.
如何打印下面的所有项目.(任何种类都可以)
A A Ab Aab Aba AB ABa ABb ABab ABba B Ba Bb Bab Bba
(大写号码没有交换.小字符应该被交换.并且始终跟随大写号码附加小字符.)
据我所知,如果我宣布一个字典,我可以调用myDict.Clear()来重用目的.
现在,如果我宣布一个sb作为StingBuilder obj.
StringBuilder sb = new StringBuilder();
Run Code Online (Sandbox Code Playgroud)
如何重用某人?谢谢.
实际上我需要打印mainDict的所有可能条件.
像这样的sb表达式之一(包括在下面的代码中)
sb.AppendFormat("{0}/{1}/{2}/{3}, {4}", pair1.Key, pair2.Key, pair3.Key, pair4.Key, pair4.Value);
Console.WriteLine(sb.ToString());
Run Code Online (Sandbox Code Playgroud)
如果我声明了很多StringBuilder objs,我仍然无法检测到有多少obj对我来说已经足够了.实际上mainDict非常复杂.上面的代码只是一种做法.谢谢.
代码于04年1月更新.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
class test
{
private static Dictionary<string, object> mainDict = new Dictionary<string, object>();
public static void Main()
{
Dictionary<string, object> aSubDict = new Dictionary<string,object>();
Dictionary<string, object> aSub1Dict = new Dictionary<string, object>();
Dictionary<string, object> aSub2Dict = new Dictionary<string, object>();
Dictionary<string, object> aSub3Dict = new Dictionary<string, object>();
Dictionary<string, object> aSub4Dict = new Dictionary<string, …Run Code Online (Sandbox Code Playgroud) 使用系统; 使用System.Collections.Generic; 使用System.Text;
namespace MyConApp
{
class Program
{
static void Main(string args)
{
string tmpString;
tmpString = args;
Console.WriteLine("Hello" + tmpString);
}
}
}
Run Code Online (Sandbox Code Playgroud)
为什么下面的表达式显示编译错误消息"不包含适用于入口点的静态'Main'方法"
namespace MyConApp
{
class Program
{
static void Main(string args)
{
string tmpString;
tmpString = args;
Console.WriteLine("Hello" + tmpString);
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我什么时候需要插入/不插入&了scanf()用C?谢谢.
int main()
{
char s1[81], s2[81], s3[81];
scanf("%s%s%s", s1, s2, s3);
// If replace scanf() with the expression below, it works too.
// scanf("%s%s%s", &s1, &s2, &s3);
printf("\ns1 = %s\ns2 = %s\ns3 = %s", s1, s2, s3);
return 0;
}
//programming is fun
//
//s1 = programming
//s2 = is
//s3 = fun
Run Code Online (Sandbox Code Playgroud) 据我所知,为字典添加值的方法如下.
Dictionary<string, string> myDict = new Dictionary<string, string>();
myDict.Add("a", "1");
Run Code Online (Sandbox Code Playgroud)
如果我将"myDictDict"声明为下面的样式.
IDictionary<string, Dictionary<string, string>> myDictDict = new Dictionary<string, Dictionary<string, string>>();
myDictDict .Add("hello", "tom","cat"); ?// How to add value here.
Run Code Online (Sandbox Code Playgroud)
谢谢.
activePerl 5.8基于
#!C:\Perl\bin\perl.exe
use strict;
use warnings;
# declare a new hash
my %some_hash;
%some_hash = ("foo", 35, "bar", 12.4, 2.5, "hello",
"wilma", 1.72e30, "betty", "bye\n");
my @any_array;
@any_array = %some_hash;
print %some_hash;
print "\n";
print @any_array;
print "\n";
print $any_array[0];
print "\n";
print $any_array[1];
print "\n";
print $any_array[2];
print "\n";
print $any_array[3];
print "\n";
print $any_array[4];
print "\n";
print $any_array[5];
print "\n";
print $any_array[6];
print "\n";
print $any_array[7];
print "\n";
print $any_array[8];
print "\n";
print $any_array[9];
Run Code Online (Sandbox Code Playgroud)
输出为此
D:\learning\perl>test.pl
bettybye …Run Code Online (Sandbox Code Playgroud) 我在Windows XP上使用ActivePerl 5.8.
use strict;
use warnings;
use Data::Dumper;
Run Code Online (Sandbox Code Playgroud)
我的脚本中使用了三个子例程.
要检测调用堆栈,我只能插入一些print "some location";并从控制台窗口检查打印结果.
有什么好方法可以监控它吗?谢谢.
昨天安装VS2010后 - (安装了VS2005和VS2010),我找不到字体和颜色 - >字体(下拉列表)中的" FixedSys "样式字体.
我仍然可以在VS2005中使用该字体.
[更新]我刚搜索"C:\ WINDOWS\Fonts",文件夹中没有Fixedsys样式.
有关如何在Visual Studio 2010中选择使用FixedSys的任何建议吗?