我有一个jar文件.我想知道JAR文件中的类使用了哪些外部类和方法.谁能建议我任何工具?
例如 - 如果以下两个类被打包到Myjar.jar中
import java.util.Vector;
class MyJarClass{
public static void main(String args[]){
Vector v = new Vector();
AnotherClass another = new AnotherClass();
v.addElement("one");
another.doSomething();
}
}
class AnotherClass{
void doSomething(){
}
}
Run Code Online (Sandbox Code Playgroud)
当我将JAR提供给工具时 - 该工具应显示java.util.Vector并Vector.adElements()来自外部源(MyJar.jar中不存在)
忘了提,我没有访问源代码.
正如标题中所描述的那样,我只是想找出SharePoint 2010存储elements.xml和schema.xml文件的定制位置content types以及list definitions是否有人可以提供帮助.
我想要做的是在浏览器中的SharePoint GUI中设计我的自定义内容类型和列表,然后去提取SharePoint生成的文件,以便在Visual Studio中构建的解决方案中使用,而不是从头开始手动编码所有内容.
希望有道理!谢谢!
我知道属性有一些优点,但如果你认为你不需要属性,那么将它作为公共实例有什么害处?
人们说如果你稍后尝试将公共字段更改为属性会破坏代码,但根据我的经验,将其更改为属性不会破坏任何内容.
给定此字符串值列表:
"12345","6789a","9876","23467b"
我们如何在C#中使用Linq语句来只选择整数?换句话说,我们只想回归12345和9876.
我遇到了一些应用程序的问题.当我在本地磁盘上执行它时,一切都是正确的,但是当我尝试从共享资源(Z:\ resource\TheApplication.exe)执行相同的应用程序时,我收到以下错误:
Error occurred creating the configuration section handler for DOMAIN/DomainUserInfo: Request failed
Run Code Online (Sandbox Code Playgroud)
尝试读取时出现错误自定义栏目中的配置文件:
public static class AppConfigFile {
public static IDomainUserInfo DomainUserInfo {
get {
if (_domainUserInfo == null) {
_domainUserInfo = (DomainUserInfo)ConfigurationManager.GetSection(Environment.UserDomainName + @"/DomainUserInfo");
} return _domainUserInfo as IDomainUserInfo;
}
}
}
public class DomainUserInfo : ConfigurationSection, IDomainUserInfo {
[ConfigurationProperty("SomeConfiguration", IsRequired = true, DefaultValue = "")]
public string SomeConfiguration { get { return (string)base["SomeConfiguration"]; } }
[ConfigurationProperty("OtherConfiguration", IsRequired = true, DefaultValue = "")]
public …Run Code Online (Sandbox Code Playgroud) 我正在尝试检测我们的应用程序是否从DVD运行(因为这会禁用/启用逻辑中的功能).到目前为止,我已经提出了下面的代码片段似乎可行,但我真的想知道是否有最佳实践来检测这一点.
public static bool IsDVDInstallation()
{
try
{
string location = Assembly.GetExecutingAssembly().Location;
var info = new DriveInfo(Path.GetPathRoot(location));
return info.DriveType == DriveType.CDRom;
}
catch
{
return false;
}
}
Run Code Online (Sandbox Code Playgroud) 大家好,我有一些有趣的情况。
我想计算从20:00到01:00 AM有多少小时(以分钟为单位),但我不知道如何,因为我所做的是:
pabaigosLaikoLaukelis = 01:00;
pradziosLaikoLaukelis = 20:00;
TimeSpan dt = Convert.ToDateTime(pabaigosLaikoLaukelis)- Convert.ToDateTime(pradziosLaikoLaukelis);
int minutes = (int)dt.TotalMinutes;
Run Code Online (Sandbox Code Playgroud)
我得到结果-> -1140分钟,但我需要从20:00到01:00只是5个小时的答案。
我知道这很容易,但是我不知道该怎么做。
我不理解erorr消息以及如何解决它以及它为什么会发生.这是代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Threading;
namespace GatherLinks
{
class BackgroundWebCrawling
{
public string f;
int counter = 0;
List<string> WebSitesToCrawl;
int MaxSimultaneousThreads;
BackgroundWorker mainBackGroundWorker;
BackgroundWorker secondryBackGroundWorker;
WebcrawlerConfiguration webcrawlerCFG;
List<WebCrawler> webcrawlers;
int maxlevels;
public event EventHandler<BackgroundWebCrawling> ProgressEvent;
Run Code Online (Sandbox Code Playgroud)
错误发生在ProgressEvent上
错误1类型'GatherLinks.BackgroundWebCrawling'不能用作泛型类型或方法'System.EventHandler'中的类型参数'TEventArgs'.没有从'GatherLinks.BackgroundWebCrawling'到'System.EventArgs'的隐式引用转换.
我正在尝试读取XML文件,以便将数据集成到Windows Phone App中.
我跟着其他一些主题,但是我无法让它工作(我觉得我差点就在这一点但仍然缺少一些东西).
我想读的XML是:
<?xml version="1.0" encoding="utf-8"?>
<items>
<item value="0">status</item>
<item value="210">online</item>
<item value="22h 49m 49s">uptime</item>
<item value="90">latency</item>
<item value="423">maxplayers_ever</item>
<item value="263">maxplayers_week</item>
<item value="252">maxplayers</item>
</items>
Run Code Online (Sandbox Code Playgroud)
它包含游戏服务器的信息.
我正在从URL读取它,这是我使用的代码:
public class Item
{
public string Name { get; set; }
public string Value { get; set; }
}
private void LoadXMLFile()
{
WebClient wc = new WebClient();
wc.DownloadStringCompleted += HttpsCompleted;
wc.DownloadStringAsync(new Uri("https://www.forgottenlands.eu/data.xml.php"));
}
private void HttpsCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error == null)
{
this.Items.Add(new ItemViewModel() { LineOne = "TEST …Run Code Online (Sandbox Code Playgroud) 我想通过我的Membership表查询以获得某个成员的结果,但我得到了错误的结果.这是我的查询:
select MemNo, MemDOB, MemberType, MemShrBal
From Membership
Where MemberType = 1 or MemberType = 2
and MemDOB > '1973/12/31'
and MemShrBal = 250.00
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮我找出原因:除了正确的会员记录,我还得到超过250.0及以下'1973'的成员记录?MemShrBalMemDOB
尝试使用以下代码编写PDF文档:
document = new Document();
PdfWriter writer = null; ;
try
{
writer = PdfWriter.GetInstance(document, new FileStream(@"E:\mergFiles", FileMode.Create));
}
catch (Exception xc)
{ }
Run Code Online (Sandbox Code Playgroud)
我得到一个例外:
{System.UnauthorizedAccessException: Access to the path 'E:\mergFiles' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) …Run Code Online (Sandbox Code Playgroud) 我想像2013年4月28日星期三格式化日期.任何人都知道一个简单的代码来格式化这样的日期?
我知道这是一个愚蠢的问题,但我只想知道以下给定陈述中的区别:
Abc object= new ABC();
object.Age=obj1.Age;
object.Place=obj1.Place;
object.Street=obj1.Street;
object.Number=obj1.Number;
object.POBox=obj1.POBox;
Run Code Online (Sandbox Code Playgroud)
和
Abc object= new ABC()
{
Age=obj1.Age,
Place=obj1.Place,
Street=obj1.Street,
Number=obj1.Number,
POBox=obj1.POBox
};
Run Code Online (Sandbox Code Playgroud)
以上编写的代码是否有助于提高性能?我只想知道在创建类的对象并将值分配给该类对象时,是否有任何方法可以提高性能?
c# ×10
.net ×2
datetime ×2
linq ×2
app-config ×1
class-design ×1
driveinfo ×1
events ×1
exception ×1
field ×1
formatting ×1
generics ×1
int ×1
jar ×1
java ×1
java-me ×1
jvm ×1
parsing ×1
pdf-writer ×1
performance ×1
properties ×1
sharepoint ×1
sql ×1
xml ×1
xml-parsing ×1